•  
     

Anti-flood - AMXX

Configure o amx_flood_time para 2 no arquivo amxx.cfg

Código: Selecionar todos

#include <amxmodx>
new Float:g_Flooding[MAX_PLAYERS + 1] = {0.0, ...}
new g_Flood[MAX_PLAYERS + 1] = {0, ...}
new amx_flood_time;
public plugin_init(){
register_plugin("Anti Flood", AMXX_VERSION_STR, "AMXX Dev Team")
register_dictionary("antiflood.txt")
register_clcmd("say", "chkFlood")
register_clcmd("say_team", "chkFlood")
amx_flood_time=register_cvar("amx_flood_time", "2")
}
public chkFlood(id){
new Float:maxChat = get_pcvar_float(amx_flood_time)
if(maxChat){
new Float:nexTime = get_gametime()
if(g_Flooding[id] > nexTime){
if(g_Flood[id] >= 3){
server_cmd("kick #%d ^"Proibido Floods!^"",get_user_userid(id))
return PLUGIN_HANDLED
}
g_Flood[id]++
}
else if(g_Flood[id]){
g_Flood[id]--
}
g_Flooding[id] = nexTime + maxChat
}
return PLUGIN_CONTINUE
}


antiflood.amxx
antiflood.sma