mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
Changed antiflood to be more intelligent.
This commit is contained in:
parent
3c22ae73a1
commit
09e13f5dd9
@ -34,7 +34,8 @@
|
|||||||
|
|
||||||
#include <amxmodx>
|
#include <amxmodx>
|
||||||
|
|
||||||
new Float:g_Flooding[33]
|
new Float:g_Flooding[33] = {0, ...}
|
||||||
|
new g_Flood[33] = {0, ...}
|
||||||
|
|
||||||
public plugin_init()
|
public plugin_init()
|
||||||
{
|
{
|
||||||
@ -54,9 +55,16 @@ public chkFlood(id)
|
|||||||
|
|
||||||
if ( g_Flooding[id] > nexTime )
|
if ( g_Flooding[id] > nexTime )
|
||||||
{
|
{
|
||||||
client_print( id , print_notify , "** Stop flooding the server!" )
|
if (g_Flood[id] >= 3)
|
||||||
g_Flooding[ id ] = nexTime + maxChat + 3.0
|
{
|
||||||
return PLUGIN_HANDLED
|
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
|
g_Flooding[id] = nexTime + maxChat
|
||||||
|
Loading…
Reference in New Issue
Block a user