detecting speed cheat
#1

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?
Reply
#2

Show us your GetVehicleSpeed function.
Reply
#3

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;
}
Reply
#4

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
Reply
#5

it's auto ban, any code suggestion on how to check the z speed?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)