PHP Code:
const PRIMARY_WEAPONS = ( 1 << CSW_AK47 ) | ( 1 << CSW_AUG ) | ( 1 << CSW_GALIL );
static iWeapons[ 32 ], iWeaponsCount, i, bool: bHasPrimary;
iWeaponsCount = 0, bHasPrimary = false;
get_user_weapons( iPlayer, iWeapons, iWeaponsCount );
for( i = 0; i < iWeaponsCount; i++ )
{
if( ( 1 << iWeapons[ i ] ) & PRIMARY_WEAPONS )
{
bHasPrimary = true;
break;
}
}
if( bHasPrimary )
{
/* do this */;
}
__________________