updated to use the multi-lingual system | better code style

This commit is contained in:
Felix Geyer 2004-08-03 20:30:19 +00:00
parent e4713629d9
commit 321fe54d81

View File

@ -37,32 +37,28 @@
new Float:g_Flooding[33] = {0.0, ...} new Float:g_Flooding[33] = {0.0, ...}
new g_Flood[33] = {0, ...} new g_Flood[33] = {0, ...}
public plugin_init() public plugin_init() {
{
register_plugin("Anti Flood",AMXX_VERSION_STR,"AMXX Dev Team") register_plugin("Anti Flood",AMXX_VERSION_STR,"AMXX Dev Team")
register_clcmd("say","chkFlood") register_clcmd("say","chkFlood")
register_clcmd("say_team","chkFlood") register_clcmd("say_team","chkFlood")
register_cvar("amx_flood_time","0.75") register_cvar("amx_flood_time","0.75")
} }
public chkFlood(id) public chkFlood(id) {
{
new Float:maxChat = get_cvar_float("amx_flood_time") new Float:maxChat = get_cvar_float("amx_flood_time")
if ( maxChat ) if ( maxChat ) {
{
new Float:nexTime = get_gametime() new Float:nexTime = get_gametime()
if ( g_Flooding[id] > nexTime ) if ( g_Flooding[id] > nexTime ) {
{ if (g_Flood[id] >= 3) {
if (g_Flood[id] >= 3) client_print( id , print_notify , "** %L **", id, "STOP_FLOODING" )
{
client_print( id , print_notify , "** Stop flooding the server!" )
g_Flooding[ id ] = nexTime + maxChat + 3.0 g_Flooding[ id ] = nexTime + maxChat + 3.0
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
g_Flood[id]++ g_Flood[id]++
} else { }
else {
if (g_Flood[id]) if (g_Flood[id])
g_Flood[id]-- g_Flood[id]--
} }