Aki esta o 2º
AKI :
#include < amxmodx >
new Float:g_Flooding[33] = {0.0, ...}
new g_Flood[33] = {0, ...}
//new bool:g_blockNameChange = false
new Float:g_nextNameChange[32]
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")
register_cvar("amx_flood_time","0.90")
register_cvar("amx_nameflood_time", "10.0")
register_message(get_user_msgid("SayText"), "message_SayText")
}
public message_SayText() {
if (get_msg_args() != 4)
return PLUGIN_CONTINUE
new buffer[21]
get_msg_arg_string(2, buffer, 20)
if (!equal(buffer, "#Cstrike_Name_Change"))
return PLUGIN_CONTINUE
new id = get_msg_arg_int(1), oldName[32], newName[32]
get_msg_arg_string(3, oldName, 31)
get_msg_arg_string(4, newName, 31)
if (!equal(oldName, newName) && get_gametime() < g_nextNameChange[id - 1]) {
g_nextNameChange[id - 1] = get_gametime() + get_cvar_float("amx_nameflood_time")
server_cmd( "kick #%d ^"Proibido Nick Flood!^"", get_user_userid( id ) )
set_user_info(id, "name", oldName)
return PLUGIN_HANDLED
}
g_nextNameChange[id - 1] = get_gametime() + get_cvar_float("amx_nameflood_time")
//console_print(id, "Next name change for you is %f, now is %f...", g_nextNameChange[id - 1], get_gametime())
return PLUGIN_CONTINUE
}
public chkFlood(id) {
new Float:maxChat = get_cvar_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 ) )
g_Flooding[ id ] = nexTime + maxChat + 3.0
return PLUGIN_HANDLED
}
g_Flood[id]++
}
else {
if (g_Flood[id])
g_Flood[id]--
}
g_Flooding[id] = nexTime + maxChat
}
return PLUGIN_CONTINUE
}
Plugin muito bom para evitar ataques Say Flood e Cheat que muda de nick rápidoAjudei Clica Ali no [+]