Raised This Month: $ Target: $400
 0% 

Help with blocking command


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
vitorrossi
Senior Member
Join Date: Apr 2012
Location: NY, USA
Old 08-28-2012 , 20:57   Help with blocking command
Reply With Quote #1

Hey guys, I'm trying to write a code that allows players to use the command "impulse 100" twice every round. This is the very first time I try to write a plugin, so please bear with me. I also wanted it to be applied only to CTs but not Ts, and I have no idea how to do that. Could anyone help?
Thank you


Code:
#include <amxmodx>
#include <fun>

new bool:bAlreadyUsed[ 33 ] 

public plugin_init()

{     
    register_event( "HLTV" , "evNewRound" , "a" , "1=0" , "2=0" );     
    
    register_clcmd( "impulse 100" , GiveVitamins ); 
    
} 

public evNewRound( )     
    arrayset( bAlreadyUsed , false , sizeof( bAlreadyUsed ) ); 

public GiveVitamins( id ) 
{     
    if( is_user_alive( id ) )
    {         
        if( bAlreadyUsed[ id ] )         
        {             
            client_print( id , print_chat , "You already used your Special this round!" );
        }             
        
        else         
        {             
            bAlreadyUsed[ id ] = true  
        }     
    } 
}

I tried to edit someone's else code that was trying to do something similar

Last edited by vitorrossi; 08-28-2012 at 20:58.
vitorrossi 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 05:51.


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