15.01.2014, 12:32
Let's take a closer look at what actually happens here;
If the player is unarmed, the statement becomes this:
0 is equal to 0 so the first part is false. However, 0 isn't equal to 46 so that part becomes true!
The statement ultimately becomes true and the statement gets executed.
Edit: Your usage of GetPlayerArmour is wrong, as well. GetPlayerArmour in itself, like you use it, only returns 0 or 1 depending on whether the function succeeded. The actual health value gets saved in the 'Float:Armour' variable. This is the value you want to compare, not the return value of the function.
pawn Код:
if(GetPlayerWeapon(playerid) != 0 || GetPlayerWeapon(playerid) != 46 ) Ban(playerid);
pawn Код:
if(0 != 0 || 0 != 46 ) Ban(playerid);
pawn Код:
if(false || true) Ban(playerid);
Edit: Your usage of GetPlayerArmour is wrong, as well. GetPlayerArmour in itself, like you use it, only returns 0 or 1 depending on whether the function succeeded. The actual health value gets saved in the 'Float:Armour' variable. This is the value you want to compare, not the return value of the function.