From 09e13f5dd9a270422cf6b02cc426f991d7b2e2e3 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 29 Jun 2004 20:29:40 +0000 Subject: [PATCH] Changed antiflood to be more intelligent. --- plugins/antiflood.sma | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/antiflood.sma b/plugins/antiflood.sma index 25d965c2..f16030c9 100755 --- a/plugins/antiflood.sma +++ b/plugins/antiflood.sma @@ -34,7 +34,8 @@ #include -new Float:g_Flooding[33] +new Float:g_Flooding[33] = {0, ...} +new g_Flood[33] = {0, ...} public plugin_init() { @@ -54,9 +55,16 @@ public chkFlood(id) if ( g_Flooding[id] > nexTime ) { - client_print( id , print_notify , "** Stop flooding the server!" ) - g_Flooding[ id ] = nexTime + maxChat + 3.0 - return PLUGIN_HANDLED + if (g_Flood[id] >= 3) + { + client_print( id , print_notify , "** Stop flooding the server!" ) + 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