tasks should not be used for cmds cooldown.
Removed engine and use only 1 cvar :
PHP Code:
#include <amxmodx>
#define PLUGIN "Stop Radio Flood"
#define VERSION "1.2"
#define AUTHOR "Starsailor"
new g_szRadio[][] =
{
"radio1", "coverme", "takepoint", "holdpos", "regroup", "followme", "takingfire",
"radio2", "go", "fallback", "sticktog", "getinpos", "stormfront", "report",
"radio3", "roger", "enemyspot", "needbackup", "sectorclear", "inposition", "reportingin", "getout", "negative", "enemydown"
}
new Float:g_fNextRadio[33]
new g_pTime
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
for(new i = 0; i < sizeof(g_szRadio); i++)
{
register_clcmd(g_szRadio[i], "cmdRadio")
}
g_pTime = register_cvar("srf_time","5")
}
public cmdRadio(id)
{
new Float:fDelay = get_pcvar_float(g_pTime)
if( fDelay )
{
new Float:fTime = get_gametime()
if(g_fNextRadio[id] > fTime)
{
client_print(id,print_center,"** Stop flooding with radio **")
return PLUGIN_HANDLED_MAIN
}
g_fNextRadio[id] = fTime + fDelay
}
return PLUGIN_CONTINUE
}
__________________