detecting speed 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)
+--- Thread: detecting speed cheat (
/showthread.php?tid=460400)
detecting speed cheat -
ajwar - 28.08.2013
code used:
pawn Код:
new final_speed_int = floatround(GetVehicleSpeed(iVehicleID));
if(final_speed_int>280) ban
The problem is that it detects cheating even when a car falls from hill. Any suggestions on how to fix that?
Re: detecting speed cheat -
Dragonsaurus - 28.08.2013
Show us your GetVehicleSpeed function.
Re: detecting speed cheat -
ajwar - 28.08.2013
pawn Код:
stock Float:GetVehicleSpeed(vehicleid,UseMPH = 0)
{
new Float:speed_x,Float:speed_y,Float:speed_z,Float:temp_speed;
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
if(UseMPH == 0)
{
temp_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*140.666667;
} else {
temp_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*85.4166672;
}
floatround(temp_speed,floatround_round);return temp_speed;
}
Re: detecting speed cheat -
CutX - 28.08.2013
you could check the Z velocity and see if only Z changes fast while X & Y just a little bit.
Cuz when you fall, only Z will change (X & Y too ofc. but not so much if you fall straight down)
The other thing you could do is, send a message to the Admins.
They can then check if he's really just falling or hacking. In situations like this where you can't
really see if the player is hacking or not, it's best to send a message to the Admins and then crash the hackers client
Re: detecting speed cheat -
ajwar - 28.08.2013
it's auto ban, any code suggestion on how to check the z speed?
Re: detecting speed cheat -
Dragonsaurus - 28.08.2013
Try to place a new function called GetVehicleXYSpeed, where to calculate only x and y axis speed.
pawn Код:
stock Float:GetVehicleXYSpeed(vehicleid,UseMPH = 0)
{
new Float:speed_x,Float:speed_y,Float:speed_z,Float:temp_speed;
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z); if(UseMPH == 0)
{
temp_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))*140.666667;
}
else
{
temp_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))*85.4166672;
}
floatround(temp_speed,floatround_round);
return temp_speed;
}
And use this callback to check only X and Y axis.