Comparing two floats for anti-cheat
#1

Hello, i'm trying to make an anti cheat for the cheat function that instantly changes your car direction, a full 180 degrees, so you drive in the total opposite direction instantly, so far I've got this, but it doesn't seem to work correctly, it's VERY unreliable. Sometimes, just slightly veering off a straight line can trigger it?!

Any ideas?

http://pastebin.com/m2e917af7
Reply
#2

pawn Код:
GetVehicleZAngle(GetPlayerVehicleID(playerid), AccountInfo[playerid][NewZAngle]);
if(floatabs(AccountInfo[playerid][NewZAngle] - AccountInfo[playerid][OldZAngle]) > 160)
{
  SendClientMessage(playerid,COLOR_RED,"O JEEZ, NOT THIS SHIT AGAIN!");
}
Try?
Reply
#3

Quote:
Originally Posted by Finn
pawn Код:
GetVehicleZAngle(GetPlayerVehicleID(playerid), AccountInfo[playerid][NewZAngle]);
if(floatabs(AccountInfo[playerid][NewZAngle] - AccountInfo[playerid][OldZAngle]) > 160)
{
  SendClientMessage(playerid,COLOR_RED,"O JEEZ, NOT THIS SHIT AGAIN!");
}
Try?
That should work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)