View Single Post
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 06-13-2009 , 03:37   Re: Stop Radio Flood v1.0
Reply With Quote #7

v1.1 (I wonder if setting a task after each radio cmd usage is faster than gametime):
Code:
#include <amxmodx> #include <engine>   #define PLUGIN "Stop Radio Flood" #define VERSION "1.1" #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:gRadio[33],pTime,pEnabled   public plugin_init() {                 register_plugin(PLUGIN, VERSION, AUTHOR)           for (new i = 0; i < sizeof(g_szRadio); i++)                 register_clcmd(g_szRadio[i], "cmdRadio");           pTime = register_cvar("srf_time","5")         pEnabled = register_cvar("srf_enabled","1")           register_cvar("srf_version",VERSION,FCVAR_SERVER|FCVAR_SPONLY) } public cmdRadio(id){           if(get_pcvar_num(pEnabled)){                           new Float:fTime = halflife_time()                   if(fTime - gRadio[id] < get_pcvar_num(pTime)){                                   client_print(id,print_center,"** Stop flooding with radio **")                           return 1                 }                   gRadio[id] = fTime         }           return PLUGIN_CONTINUE }
__________________
hleV is offline