Thanks, I'm gonna try.
Edit: I have now imported the things out of antiflood.sma but I can't really set
a definite time of 5 minutes. Tried many things and it gags me kinda randomly.
For example I set the amx_namespam_time to "300" and right after I connect I can
"SPAM" 3-4 times without any gag. Then I get gagged. Usually I should only be able to say
it one time, then 2nd time -> gag.
Code:
#include <amxmodx>
#include <engine>
new Float:g_Flooding[33] = {0.0, ...}
new g_Flood[33] = {0, ...}
new amx_namespam_time;
public plugin_init()
{
register_plugin("Chat-Abuse Punisher","0.01","wayz")
register_clcmd("say", "CmdSpam")
register_clcmd("say_team", "CmdSpam")
amx_namespam_time=register_cvar("amx_namespam_time", "300")
}
public CmdSpam(id)
{
new Float:maxChat = get_pcvar_float(amx_namespam_time)
new said[192]
read_args(said,192)
new name[32]
get_user_name(id, name, 31)
if (maxChat)
{
new Float:nexTime = get_gametime()
if (g_Flooding[id] > nexTime)
{
if (g_Flood[id] >= 3)
{
if( ( containi(said, "SPAM") != -1 ) )
{
server_cmd("amx_gag %s 1", name)
}
g_Flooding[id] = nexTime + maxChat + 3
}
g_Flood[id]++
}
else if (g_Flood[id])
{
g_Flood[id]--
}
g_Flooding[id] = nexTime + maxChat
}
}