My anti cheat isnt working
#3

Let's take a closer look at what actually happens here;
pawn Код:
if(GetPlayerWeapon(playerid) != 0 || GetPlayerWeapon(playerid) != 46 ) Ban(playerid);
If the player is unarmed, the statement becomes this:

pawn Код:
if(0 != 0 || 0 != 46 ) Ban(playerid);
0 is equal to 0 so the first part is false. However, 0 isn't equal to 46 so that part becomes true!

pawn Код:
if(false || true) Ban(playerid);
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.
Reply


Messages In This Thread
My anti cheat isnt working - by nuriel8833 - 15.01.2014, 12:15
Re: My anti cheat isnt working - by EmilLykke - 15.01.2014, 12:19
Re: My anti cheat isnt working - by Vince - 15.01.2014, 12:32
Re: My anti cheat isnt working - by EmilLykke - 15.01.2014, 12:40
Re: My anti cheat isnt working - by nuriel8833 - 15.01.2014, 12:46
Re: My anti cheat isnt working - by EmilLykke - 15.01.2014, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)