PHP Code:
const SOME_WEAPONS_I_WANT = ( 1 << CSW_USP ) | ( 1 << CSW_M4A1 );
static iWeapons[ 32 ], iNum, i;
iNum = 0;
get_user_weapons( iPlayer, iWeapons, iNum );
// iNum -> Weapons count
// iWeapons[ 0 ] -> First weapon
// iWeapons[ 1 ] -> Second weapon
for( i = 0; i < iNum; i++ )
if( ( 1 << iWeapons[ i ] ) & SOME_WEAPONS_I_WANT ) // If this weapon we are currently parsing is contained in SOME_WEAPONS_I_WANT bitsum then:
{ /* Your code */ }
Of course, CSW_*, DODW_*, TFW_*.