Speed hack giving fake data about players speed
#5

Well you could just compare distance what is travaled with 1 second, when distance is too big, just ban player.
Vehicle speed checking can be avoided when hack teleports vehicle very fast forward, vehicle velocity doesn't change then.

example of vehicle anticheat
PHP Code:
// easy timer creation
#include <YSI_Coding\y_timers>
// definitons
#define MAX_WARNINGS            3
#define MAX_VEHICLE_DISTANCE    60.0
enum eAnticheat{
    
Float:LastPos[4],
    
LastWarning,
    
WarningCount
};
new 
Anticheat[MAX_PLAYERS][eAnticheat];
public 
OnPlayerConnect(playerid){
    
Anticheat[playerid][WarningCount] = 0;
    return 
1;
}
Float:GetDistance(Float:xFloat:yFloat:zFloat:x2Float:y2Float:z2){
    return 
VectorSize(x2y2z2);
}
ptask CheckPlayerMovement[1000](pid){
    if(
GetPlayerState(pid) == PLAYER_STATE_DRIVER && Anticheat[pid][WarningCount] != MAX_WARNINGS){
        
// get vehicle current position
        
new Float:xFloat:yFloat:z;
        
GetVehiclePos(GetPlayerVehicleID(pid), xyz);
        
// checks traveled distance
        
new Float:dis GetDistance(xyzAnticheat[pid][LastPos][0], Anticheat[pid][LastPos][1], Anticheat[pid][LastPos][2]);
        if(
dis MAX_VEHICLE_DISTANCE){
            
// warning counter, because of many false-positives
            
new time gettime();
            if(
time Anticheat[pid][LastWarning] > 10){
                
Anticheat[pid][WarningCount] = 0;
            }
            
Anticheat[pid][WarningCount] += 1;
            
Anticheat[pid][LastWarning] = time;
            if(
Anticheat[pid][WarningCount] == MAX_WARNINGS){
                
DisablePlayerAccount(pid"Vehicle teleport/speed hacking!");
            }
        }
        
// saves current position
        
Anticheat[pid][LastPos][0] = x;
        
Anticheat[pid][LastPos][1] = y
        
Anticheat[pid][LastPos][2] = z;
    }
    return 
1;
}
DisablePlayerAccount(pid, const msg[]){
    
/// ...
    
return 1;

Reply


Messages In This Thread
Speed hack giving fake data about players speed - by TokicMajstor - 06.03.2020, 18:38
Re: Speed hack giving fake data about players speed - by Adamoneoone - 06.03.2020, 19:14
Re: Speed hack giving fake data about players speed - by Symon - 06.03.2020, 19:17
Re: Speed hack giving fake data about players speed - by Freedom. - 07.03.2020, 22:13
Re: Speed hack giving fake data about players speed - by l0gic - 07.03.2020, 23:19

Forum Jump:


Users browsing this thread: 1 Guest(s)