View Single Post
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-13-2009 , 04:01   Re: Stop Radio Flood v1.0
Reply With Quote #8

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(PLUGINVERSIONAUTHOR)

    for(new 
0sizeof(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

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 06-13-2009 at 04:57.
ConnorMcLeod is offline