SA-MP Forums Archive
anti-speedhack needed - 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: anti-speedhack needed (/showthread.php?tid=633393)



anti-speedhack needed - ax1 - 30.04.2017

can someone give me a script (anti-cheat) that would detect if player is using speedhack? I need the one that detects if player speed increases too fast, so far I've only found the ones that checks if overall speed isn't too big.


Re: anti-speedhack needed - DavidSF - 30.04.2017

if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i)) && PlayerInfo[i][pAdmin] < 6) {
new Float:fCurrentSpeed;
fCurrentSpeed = player_get_speed(i);
fVehSpeed[i] = fCurrentSpeed;
if(fCurrentSpeed > 200) {
new string[74 + MAX_PLAYER_NAME];
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
ABroadCast(COLOR_YELLOW, string, 2);
SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);

if(GetPVarInt(i, "shW") >= 3) {
format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
AddAutomatedFlag(i, string);
}
}
}


Re: anti-speedhack needed - ax1 - 30.04.2017

Quote:
Originally Posted by DavidSF
Посмотреть сообщение
if(GetPlayerState(i) == PLAYER_STATE_DRIVER && AdminDuty[i] != 1 && !IsAPlane(GetPlayerVehicleID(i)) && PlayerInfo[i][pAdmin] < 6) {
new Float:fCurrentSpeed;
fCurrentSpeed = player_get_speed(i);
fVehSpeed[i] = fCurrentSpeed;
if(fCurrentSpeed > 200) {
new string[74 + MAX_PLAYER_NAME];
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) may possibly be speed hacking (%.0f MPH).", GetPlayerNameEx(i), i, fCurrentSpeed);
ABroadCast(COLOR_YELLOW, string, 2);
SetPVarInt(i, "shW", GetPVarInt(i, "shW")+1);

if(GetPVarInt(i, "shW") >= 3) {
format(string, sizeof(string), "%s may possibly have speed hacked (speeds of %.0f MPH).", GetPlayerNameEx(i), fCurrentSpeed);
AddAutomatedFlag(i, string);
}
}
}
read what ive wrote
Quote:
Originally Posted by ax1
Посмотреть сообщение
I need the one that detects if player speed increases too fast, so far I've only found the ones that checks if overall speed isn't too big.