mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-01-12 23:08:03 +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()
|
||||||
{
|
{
|
||||||
@ -53,11 +54,18 @@ public chkFlood(id)
|
|||||||
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)
|
||||||
{
|
{
|
||||||
client_print( id , print_notify , "** Stop flooding the server!" )
|
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]++
|
||||||
|
} else {
|
||||||
|
if (g_Flood[id])
|
||||||
|
g_Flood[id]--
|
||||||
|
}
|
||||||
|
|
||||||
g_Flooding[id] = nexTime + maxChat
|
g_Flooding[id] = nexTime + maxChat
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user