SA-MP Forums Archive
Anti speed hack problem - 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 speed hack problem (/showthread.php?tid=653730)



Anti speed hack problem - oOoBl4cKoOo - 11.05.2018

hey guys
I'm using "Speed Booster" for my server and i have problems with anti cheat
when player is using server speed booster server will send warning's

PHP код:
if(final_speed_int 240 && Cheating2[i] != 1)
                        {
                            if(!
IsAPlane(tmpcar))
                            {
                                new 
playerveh GetPlayerVehicleID(i);
                                new 
vehicles GetVehicleModel(playerveh) - 400;
                                
GetPlayerName(iplnamesizeof(plname));
                                if(
GetPlayerState(i) == PLAYER_STATE_DRIVER) {
                                
format(string256"[Anti-Cheat]: {FFFFFF}Server detected an speed hack on {FF0000}%s(%i){FFFFFF} (%i km/h) with vehicleid %i(%s).",plname,i,final_speed_int,playerveh,aVehicleNames[vehicles]);
                                
ABroadCast(COLOR_GG,string,1); }
                                
Cheating2[i] = 1;
                                
SetTimerEx("UnSentCheating",5000,0,"i",i);
                            }
                        }
    } 
and speed boost is with click left or Alt


Re: Anti speed hack problem - Lokii - 11.05.2018

use cooldown

on top add
PHP код:
static stimer[MAX_PLAYERS]; 
on your speedboost add :

PHP код:
KillTimer(stimer[playerid]);
SetPVarInt(playerid"SPDCOOL"1);
stimer[playerid] = SetTimerEx("SPDC"15000false"i"playerid); 
-------------------------------------------------------------------------------------

PHP код:
forward SPDC(playerid);
public 
SPDC(playerid)
{
    
SetPVarInt(playerid"SPDCOOL"0);
    return 
1;

PHP код:
if(final_speed_int 240 && Cheating2[i] != 1)
                        {
                            if(!
IsAPlane(tmpcar) && GetPVarInt(playerid"SPDCOOL") == 0)
                            {
                                new 
playerveh GetPlayerVehicleID(i);
                                new 
vehicles GetVehicleModel(playerveh) - 400;
                                
GetPlayerName(iplnamesizeof(plname));
                                if(
GetPlayerState(i) == PLAYER_STATE_DRIVER) {
                                
format(string256"[Anti-Cheat]: {FFFFFF}Server detected an speed hack on {FF0000}%s(%i){FFFFFF} (%i km/h) with vehicleid %i(%s).",plname,i,final_speed_int,playerveh,aVehicleNames[vehicles]);
                                
ABroadCast(COLOR_GG,string,1); }
                                
Cheating2[i] = 1;
                                
SetTimerEx("UnSentCheating",5000,0,"i",i);
                            }
                        }
    }