My anti cheat isnt working
#5

Quote:
Originally Posted by Vince
Посмотреть сообщение
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.
So how do I change it so if the player weapon is neither 0 nor 46 he will be banned? Or I can check only 46 since the weapon is always 0

Quote:
Originally Posted by EmilLykke
Посмотреть сообщение
No. He is getting banned, because when you login you always have to use /rcon login [password]. If he is NOT an admin, he will just be immidiately banned when he logs in. If he has a firearm, I mean.
But I have to check if that player is a RCON admin,since they are the only players that are allowed to use those weapons / to have armour
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: 2 Guest(s)