Example code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <cl_buy>
const g_iFlash_Max_Carry = 2; // max boughts per round
new g_iFlash[ 33 ];
new b_Blocked[ 33 ];
public client_buy( id, item )
{
if( item == CSW_FLASHBANG )
{
g_iFlash[ id ]++
g_iFlash[ id ] = cs_get_user_bpammo( id, CSW_FLASHBANG );
if( g_iFlash[ id ] == g_iFlash_Max_Carry )
{
b_Blocked[ id ] = true;
client_print( id, print_center, "You can't buy more flashbangs this round!" );
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
I have used grenade_throw from csx and blocked the flash but this way I can't make sure he had bought 2 flashes... any ideas?
What I mean is - I can block the flashbang in grenade_throw, but the player should have bought 1 grenade so he wouldn't be able to buy another one until the new round, I hope you got what I want to say.
I res the bool's value at new round.