need player spawn will get M4A1 and AK47 and 100 armor
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#define PLUGIN "Anti - Buy"
#define VERSION "1.0"
#define AUTHOR "XstRessful"
#if cellbits == 32
#define OFFSET_BUYZONE 235
#else
#define OFFSET_BUYZONE 268
#endif
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
RegisterHam(Ham_Spawn, "player", "FwdHamPlayerSpawn", 1 );
register_message( get_user_msgid( "StatusIcon" ), "msgStatusIcon" );
}
public fwHamPlayerSpawn( id )
{
if ( is_user_connected( id ) )
{
cs_set_user_money( id, 0 );
strip_user_weapons( id )
give_item( id, "weapon_knife" )
}
return PLUGIN_HANDLED;
}
public msgStatusIcon( const iMsgId, const iMsgDest, const iPlayer )
{
static szMsg[ 8 ];
get_msg_arg_string( 2, szMsg, 7 );
if( equal( szMsg, "buyzone" ) )
{
set_pdata_int( iPlayer, OFFSET_BUYZONE, get_pdata_int( iPlayer, OFFSET_BUYZONE ) & ~( 1<<0 ) );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;