amxmodx/plugins/antiflood.sma

40 lines
789 B
Plaintext
Raw Normal View History

2004-01-31 20:56:22 +00:00
/* AMX Mod script.
*
2004-02-01 18:45:44 +00:00
* (c) 2002-2004, OLO
2004-02-11 19:32:01 +00:00
* modified by the AMX Mod X Development Team
2004-01-31 20:56:22 +00:00
*
2004-02-01 18:45:44 +00:00
* This file is provided as is (no warranties).
2004-01-31 20:56:22 +00:00
*/
#include <amxmod>
new Float:g_Flooding[33]
public plugin_init()
{
2004-02-01 18:45:44 +00:00
register_plugin("Anti Flood","0.1","default")
2004-01-31 20:56:22 +00:00
register_clcmd("say","chkFlood")
register_clcmd("say_team","chkFlood")
register_cvar("amx_flood_time","0.75")
}
public chkFlood(id)
{
new Float:maxChat = get_cvar_float("amx_flood_time")
2004-02-01 18:45:44 +00:00
2004-01-31 20:56:22 +00:00
if ( maxChat )
{
new Float:nexTime = get_gametime()
2004-02-01 18:45:44 +00:00
2004-01-31 20:56:22 +00:00
if ( g_Flooding[id] > nexTime )
{
client_print( id , print_notify , "** Stop flooding the server!" )
g_Flooding[ id ] = nexTime + maxChat + 3.0
return PLUGIN_HANDLED
}
2004-02-01 18:45:44 +00:00
2004-01-31 20:56:22 +00:00
g_Flooding[id] = nexTime + maxChat
}
2004-02-01 18:45:44 +00:00
2004-01-31 20:56:22 +00:00
return PLUGIN_CONTINUE
}