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