SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 06/03/2020, 06:38 PM   #1
Huge Clucker
TokicMajstor's Avatar
Join Date: Oct 2018
Location: Bosnia And Herzegovina
Posts: 214
Reputation: 10
Default Speed hack giving fake data about players speed

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)

My work:
-MapTD - GTA SA Map on a TextDraw
TokicMajstor is offline   Reply With Quote
Old 06/03/2020, 07:14 PM   #2
Huge Clucker
Join Date: Sep 2014
Posts: 485
Reputation: 37
Default Re: Speed hack giving fake data about players speed

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.
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!
Adamoneoone is offline   Reply With Quote
Old 06/03/2020, 07:17 PM   #3
Symon's Avatar
Join Date: Apr 2019
Location: Italy
Posts: 1,004
Reputation: 107
Default Re: Speed hack giving fake data about players speed

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.
Epic Missions - An upcoming mini missions server.

Fully MySQL featured, no server restart during a mission change, many different mission types available (TDM, DM, BOMBING, LMS, LTS, DERBY etc.), perks, rewards, level system and much more. Join us and wait for the launch planned for October!

Website | Forum | Development logs | Join our Discord
Symon is offline   Reply With Quote
Old 07/03/2020, 10:13 PM   #4
Big Clucker
Join Date: Oct 2012
Posts: 126
Reputation: 12
Default Re: Speed hack giving fake data about players speed

You can check with Pawn.Raknet.
Freedom. is offline   Reply With Quote
Old 07/03/2020, 11:19 PM   #5
Huge Clucker
Join Date: Aug 2019
Posts: 221
Reputation: 59
Default Re: Speed hack giving fake data about players speed

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{

Anticheat[playerid][WarningCount] = 0;


ptask CheckPlayerMovement[1000](pid){
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]);
// warning counter, because of many false-positives
new time gettime();
time Anticheat[pid][LastWarning] > 10){
Anticheat[pid][WarningCount] = 0;
Anticheat[pid][WarningCount] += 1;
Anticheat[pid][LastWarning] = time;

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;

DisablePlayerAccount(pid, const msg[]){
/// ...
return 1;

Coding experience with: PAWN, Java, Python, Javascript, PHP and SQL for about 6 years.
If I helped you, any reputation would be appreciated.

Last edited by l0gic; 07/03/2020 at 11:53 PM.
l0gic is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vehicle fly hack /speed hack anti cheat help MBilal Scripting Help 5 08/09/2014 09:17 PM
Speed hack ! :) MatZZPL Scripting Help 17 24/04/2013 07:22 PM
[Ajuda] speed hack ~ StarAway Português/Portuguese 7 10/12/2012 05:47 PM
[Request] Speed hack .Skool_. Scripting Help 3 17/05/2012 10:01 PM

All times are GMT. The time now is 03:56 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.