Raised This Month: $ Target: $400
 0% 

block a command for a certain time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Shiro
Junior Member
Join Date: Nov 2010
Old 01-06-2011 , 06:26   block a command for a certain time
Reply With Quote #1

Hi all,
How to block a command for a certain time? For 5 or more seconds.. thanks

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "fR4gn0tiX!"

new lastused[33]

stock register_saycmd(saycommand[], function[], flags = -1info[])
{
    static 
sTemp[64]
    
formatex(sTempsizeof sTemp 1"say /%s"saycommand)
    
register_clcmd(sTemp, function, flagsinfo)
    
formatex(sTempsizeof sTemp 1"say .%s"saycommand)
    
register_clcmd(sTemp, function, flagsinfo)
    
formatex(sTempsizeof sTemp 1"say_team /%s"saycommand)
    
register_clcmd(sTemp, function, flagsinfo)
    
formatex(sTempsizeof sTemp 1"say_team .%s"saycommand)
    
register_clcmd(sTemp, function, flagsinfo)
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("gacocxleba""v1.0 by fR4gn0tiX!"FCVAR_SERVER|FCVAR_SPONLY)
    
    
register_concmd("amx_respawn""cmd_gacocxleba"ADMIN_SLAY"< saxeli | #userid > - Respawn player")    
    
register_saycmd("respawn""cl_gacocxleba"ADMIN_SLAY"Respawn yourself")            
}

public 
cmd_gacocxleba(idlevelcid)
{
    if (!
cmd_access(idlevelcid2))
       return 
PLUGIN_HANDLED
       
    
new Argument[32
    
    
read_argv(1Argument31
    
    new 
Target cmd_target(idArgumentCMDTARGET_ALLOW_SELF CMDTARGET_OBEY_IMMUNITY
    
    if (
Target
    {    
        if (
is_user_alive(Target)) 
        {
            new 
saxeli[32]            
            
get_user_name(Targetsaxeli31)    
            
            
console_print(id"%s is already alive!"saxeli
            return 
PLUGIN_HANDLED
        
}
        
        
ExecuteHamB(Ham_CS_RoundRespawnTarget)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED
}

public 
cl_gacocxleba(id)
{
    if (
is_user_alive(id)) 
    {
        
client_print(idprint_chat"You are already alive!"
        return 
PLUGIN_HANDLED
    
}
    
    
ExecuteHamB(Ham_CS_RoundRespawnid
    return 
PLUGIN_HANDLED


Last edited by Shiro; 01-06-2011 at 06:32.
Shiro is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode