SA-MP Forums Archive
Comparing two floats for anti-cheat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Comparing two floats for anti-cheat (/showthread.php?tid=97558)



Comparing two floats for anti-cheat - Redirect Left - 15.09.2009

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


Re: Comparing two floats for anti-cheat - Finn - 15.09.2009

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?


Re: Comparing two floats for anti-cheat - eXchainZ-FoReVeR - 15.09.2009

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