Jump to content

[AMXMODX] CMD Bug Fix


Don Liviu

Recommended Posts

Descriere : Acest plugin fixeaza CMD BUG FIX

 

Download : 

 

Sursa

 

 

#include <amxmodx>

#define g_Prefix "[RANGFORT]"

new kickon,mesajon,incercari;


public plugin_init()
    {
    register_plugin("CMD BUG FIX", "1.0", "Sprit3x")
    register_clcmd("say", "hook_say")
    register_clcmd("say_team", "hook_say")
    mesajon = register_cvar("mesaje_on","1") // 1 activat, 0 dezactivat
    kickon= register_cvar("kick_on","1") // 1 activat , 0 dezactivat
}
public hook_say(id)
    {
    if (!is_user_connected(id))
        return PLUGIN_HANDLED
    
    static arg[192]
    read_argv(1, arg, charsmax(arg))
    
    if (contain(arg, "%") != -1)
        {
        replace_all(arg, charsmax(arg), "%", " ")
        if(get_pcvar_num(mesajon) == 1)
            {
            print_chatColor(id,"^4[%s]^3 Esti suspectat de ^4 CMD BUG ^3 la urmatoarea incercare vei primi kick",g_Prefix)
            incercari++
        }
        if(get_pcvar_num(kickon) == 1 && incercari == 2)
            {
            new szName[33]
            get_user_name(id,szName,31)
            server_cmd("kick %s",szName)
            incercari = 0;
        }
        return PLUGIN_HANDLED
    }
    return PLUGIN_CONTINUE;
}


stock print_chatColor(const id,const input[], any:...)
    {
    new msg[191], players[32], count = 1;
    vformat(msg,190,input,3);
    replace_all(msg,190,"\g","^4");// green
    replace_all(msg,190,"\n","^1");// normal
    replace_all(msg,190,"\t","^3");// team
    
    if (id) players[0] = id; else get_players(players,count,"ch");
    for (new i=0;i<count;i++)
        if (is_user_connected(players))
        {
        message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,players);
        write_byte(players);
        write_string(msg);
        message_end();
    }
}

 

 

AMXX

 

Nume:CMD BUG FIX
Versiune: 1.0
 
Instalare 
 
1. Fisierul CmdBugFix.amxx il puneti in addons/amxmodx/plugins
2. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
 
CmdBugFix.amxx (Atentie! Inainte de chatcommands sau alte chestii cu chatul)

 

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg): 
 
mesaj_on 1 - Atentioneaza jucatorul ca este suspect de cmdbugfix
kick_on 2 - Permite sa dea kick jucatorilor care incearca sa floodeze serveru
 
 
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
-amxmodx
 
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...