Quote:
Originally Posted by Exolent[jNr]
Seems to be just a boolean value, only for showing if player has a primary weapon or not.
|
ahh Thanks.. i figured out how to use a define to do the check i needed.
PHP Code:
#define PRIMARY_WEAPON ((1 << CSW_SCOUT) | (1 << CSW_XM1014) | (1 << CSW_MAC10) | (1 << CSW_AUG) | (1 << CSW_UMP45) | (1 << CSW_SG550) | (1 << CSW_GALIL) | (1 << CSW_FAMAS) | (1 << CSW_AWP) | (1 << CSW_MP5NAVY) | (1 << CSW_M249) | (1 << CSW_M3) | (1 << CSW_M4A1) | (1 << CSW_TMP) | (1 << CSW_G3SG1) | (1 << CSW_SG552) | (1 << CSW_AK47) | (1 << CSW_P90))
#define SECONDARY_WEAPON ((1 << CSW_P228) | (1 << CSW_ELITE) | (1 << CSW_FIVESEVEN) | (1 << CSW_USP) | (1 << CSW_GLOCK18) | (1 << CSW_DEAGLE))
#define NO_BPAMMO ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4))
new currentPrimaryAmmo;
new currentSecondaryAmmo;
new maxPrimaryAmmo;
new maxSecondaryAmmo;
new szWeapon[32], iWeapons[32], iWeaponNum;
get_user_weapons(target, iWeapons, iWeaponNum);
for(new i = 0; i < iWeaponNum; i++)
{
get_weaponname(iWeapons[i], szWeapon, charsmax(szWeapon));
if(NO_BPAMMO & (1 << iWeapons[i]))
continue;
if(PRIMARY_WEAPON & (1 << iWeapons[i]))
{
client_print(id, print_chat, "Player's Primary weapon: %s", szWeapon);
client_print(target, print_chat, "Your Primary weapon: %s", szWeapon);
g_iTargetPrimaryWeapon[target] = iWeapons[i];
currentPrimaryAmmo = cs_get_user_bpammo(target, iWeapons[i]);
maxPrimaryAmmo = g_WeaponBPAmmo[iWeapons[i]];
}
if(SECONDARY_WEAPON & (1 << iWeapons[i]))
{
client_print(id, print_chat, "Player's Secondary weapon: %s", szWeapon);
client_print(target, print_chat, "Your Secondary weapon: %s", szWeapon);
g_iTargetSecondaryWeapon[target] = iWeapons[i];
currentSecondaryAmmo = cs_get_user_bpammo(target, iWeapons[i]);
maxSecondaryAmmo = g_WeaponBPAmmo[iWeapons[i]];
}
}