It depends on what you want to achieve.
If you want to check if player has any other weapon than AK (including knife and c4):
PHP Code:
stock bool:userHasOtherWeaponsThanAk(id)
{
new weapons[32];
new num;
get_user_weapons ( id, weapons, num );
if(num >1)
return true;
if(num == 1 && weapons[0] != CSW_AK47)
return true;
return false;
}
This stock will return false only if player do not have any weapons or he has got only AK.
If you want to check if player has other weapon than AK (but let him have knife and C4):
PHP Code:
stock bool:userHasOtherWeapons(id, weapon)
{
new weapons[32];
new num;
get_user_weapons ( id, weapons, num );
new weapon;
for(new i=0;i<num;i++){
weapon = weapons[i];
if(weapon != CSW_AK47
&& weapon != CSW_KNIFE //delete this line if user can not have knife
&& weapon != CSW_C4 //delete this line if user can not have C4
)
return true;
}
return false;
}
This will return false if player has other weapons than AK, knife and C4