Speed hack giving fake data about players speed -
TokicMajstor - 06.03.2020
In this video a guy shows his cheat sending fake speed info (he is going like 500 KM/h while server receives 150).
Does anybody know how to detect this with PAWNO (I wanna make it, not just install other anticheats)
https://youtu.be/699ChLvGgHA
Re: Speed hack giving fake data about players speed -
Adamoneoone - 06.03.2020
Maybe what you could do is check the player's position at two very close times (definition of speed) and compare it with what it should be normally. Like get the top speed of an infernus, the distance travalled within 1s or 0.5s and compare it with what the player has travalled during the same amount of time.
Re: Speed hack giving fake data about players speed -
Symon - 06.03.2020
Server receives 500 km/h, you can't edit how values are readed by the server as they are server sided. (Example: a server side money system).
However that's an old (and not working anymore) LUA script, which the release of 0.3.7 R2 broke almost all this garbage making them incompatible with the current Sa-Mp version (R4).
I had that cheat somewhere months ago in my pc and i tried it too, as i remember even if you set 150 km/h as a speed cap, the server will always receive the real speed. (Tested months ago).
Probably their anti speed hack is garbage that's why it doesn't get triggered.
Btw, if someone has a compatible R4 version, we can try to debug it and see what it prints.
Re: Speed hack giving fake data about players speed -
Freedom. - 07.03.2020
You can check with Pawn.Raknet.
Re: Speed hack giving fake data about players speed -
l0gic - 07.03.2020
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:x, Float:y, Float:z, Float:x2, Float:y2, Float:z2){
return VectorSize(x - x2, y - y2, z - z2);
}
ptask CheckPlayerMovement[1000](pid){
if(GetPlayerState(pid) == PLAYER_STATE_DRIVER && Anticheat[pid][WarningCount] != MAX_WARNINGS){
// get vehicle current position
new Float:x, Float:y, Float:z;
GetVehiclePos(GetPlayerVehicleID(pid), x, y, z);
// checks traveled distance
new Float:dis = GetDistance(x, y, z, Anticheat[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;
}