PHP Code:
#define PISTOL_WEAPONS_BIT (1<<CSW_GLOCK18|1<<CSW_USP|1<<CSW_P228|1<<CSW_DEAGLE|1<<CSW_FIVESEVEN|1<<CSW_ELITE)
#define SHOTGUN_WEAPONS_BIT (1<<CSW_M3|1<<CSW_XM1014)
#define SUBMACHINE_WEAPONS_BIT (1<<CSW_TMP|1<<CSW_MAC10|1<<CSW_MP5NAVY|1<<CSW_UMP45|1<<CSW_P90)
#define RIFLE_WEAPONS_BIT (1<<CSW_FAMAS|1<<CSW_GALIL|1<<CSW_AK47|1<<CSW_SCOUT|1<<CSW_M4A1|1<<CSW_SG550|1<<CSW_SG552|1<<CSW_AUG|1<<CSW_AWP|1<<CSW_G3SG1)
#define MACHINE_WEAPONS_BIT (1<<CSW_M249)
#define ALL_GUNS_BIT ( PISTOL_WEAPONS_BIT | SHOTGUN_WEAPONS_BIT | SUBMACHINE_WEAPONS_BIT | RIFLE_WEAPONS_BIT | MACHINE_WEAPONS_BIT )
#define WeaponHasAmmo(%1) ( ( 1 << %1 ) & ALL_GUNS_BIT )
public set_ammo(id)
{
static weapons[32], num, i, weapon
get_user_weapons(id, weapons, num)
for(i = 0; i < num; i++)
{
weapon = weapons[i]
if(WeaponHasAmmo(weapon))
cs_set_user_bpammo(id, weapon, 100)
}
}
__________________