SA-MP Forums Archive
[Include] svCheats - Server Protection - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] svCheats - Server Protection (/showthread.php?tid=338516)

Pages: 1 2


svCheats - Server Protection - SuperViper - 30.04.2012

Introduction

This script allows you to select all of the cheats you want protection against, change the settings for the cheats, and give certain people a certain security level to bypass anticheat checks.


Required Plugins and Includes

To use this include, you must have sscanf.

When compiling, if you get an error that sscanf2.inc wasn't found, change

pawn Код:
#include <sscanf2>
at the top of the script and remove the 2.


Functions

FunctionActionReturns
svCheats_Debug(bool: togDebug)Toggles script debugging1
svCheats_SetPlayerSecurityLevel(playerid, secLevel)Sets the player's security level1
svCheats_GetPlayerSecurityLevel(playerid)Gets the player's security levelPlayer's security level

Callbacks

CallbackCall Time
svCheats_OnPlayerCheatUpdate(playerid, cheatid)Called when svCheats detects a cheat

Cheat List

Cheat NameCall TimeNotes
CHEAT_HIGH_PINGCalled when the player's ping exceeds MAX_PING
CHEAT_WEAPON_SPAWNCalled when a player fires a weapon that wasn't gotten from svCheats_GivePlayerWeapon
CHEAT_SPEED_HACKCalled when the vehicle's speed exceeds MAX_SPEED
CHEAT_JETPACK_HACKCalled when the player has a jetpack and was not setup for it with svCheats_ToggleJetpack
CHEAT_DRIVEBYCalled when the player attempts to enter a vehicle with an invalid driveby weaponAutomatically sets the player's armed weapon to fists
CHEAT_DDRIVEBYCalled when the player attempts to enter a vehicle as a driver with a weaponAutomatically sets the player's armed weapon to fists
CHEAT_SWEARINGCalled when the player puts a swear word in the chatNot case sensative
CHEAT_AIRBREAK_HACKCalled when the player's Z coordinate isn't near the MapAndreas resultNot working right now due to MapAndreas failures
CHEAT_BUNNYHOPCalled when the amount of repeated real jumps (animation index detected) exceeds BUNNYHOP_AMOUNT
CHEAT_FLY_HACKCalled when the player's animation index is equal to one of the fly animation indexes and Z is above 4.0
CHEAT_TELEPORT_HACKCalled when the player enters an invalid interior IDOnly detects going in unused interiors and map right clicking
CHEAT_VEHICLE_REPAIRCalled when the player repairs their vehicle while not near a mod shop or pay n spray
CHEAT_CHATSPAMCalled when the amount of repeated chat lines sent by the player exceeds CHATSPAM_LINES
CHEAT_AFKCalled when the amount of minutes the player was AFK is equal to AFK_MINUTESResets when a chat message is sent, not when a command is sent
CHEAT_TABBEDCalled when a player has been paused for around 5 seconds
CHEAT_GODMODECalled when /hh returns positive for the specified player
CHEAT_NINJAJACKCalled when a player has died from being ninjajacked
CHEAT_HEALTHHACKCalled when a player spawns health or armor
CHEAT_CARRAMCalled when a player car rams another player
CHEAT_HELIBLADECalled when a player heliblades another player
CHEAT_VEHMODCalled when a player adds a modification to their vehicle in interior 0
CHEAT_SERVERADCalled when a player types a server IP or domain in chat that isn't SERVER_IP or SERVER_DOMAIN
CHEAT_FAKEPLAYERCalled when a fake player connects to flood your serverUntested, may cause issues. Need someone to test
CHEAT_FAKEKILLCalled when a player isn't streamed in to the player he killed
CHEAT_REMOTEJACKCalled when a player remotely jacks another player's vehicleUntested, may cause issues. Need someone to test
CHEAT_INVALIDMODCalled when a player adds an invalid modification to their vehicleUntested, may cause issues. Need someone to test
CHEAT_LOCKEDVEHCalled when a player enters a locked vehicleUntested, may cause issues. Need someone to test
CHEAT_SPAMKILLCalled when a player does X (DETECT_KILLS) kills in X (DETECT_SECONDS) secondsUntested, may cause issues. Need someone to test

Script Settings

pawn Код:
#define USE_FOREACH
Comment this line if you want to use regular 'for' loops instead of the foreach include by ******. To use this, you must have the foreach include.

pawn Код:
#define USE_YHOOKS
Comment this line if you want to use regular 'ALS' hooks instead of the y_hooks include by ******. To use this, you must have the y_hooks include or YSI.

pawn Код:
#define USE_ZCMD
Comment this line if you want to use regular 'strcmp' commands instead of the ZCMD include by Zeex. To use this, you must have the ZCMD include.

pawn Код:
#define ACSTATS_USED
Comment this line if you want to disable /acstats, which shows the amount of hackers detected by svCheats.

pawn Код:
#define HH_USED
Comment this line if you want to disable /hh, which checks the specified player for godmode.

pawn Код:
#define TIMER_TIME 1250
This defines how fast the cheat detecting timer is. The faster it is, the slower the server is.

pawn Код:
#define MAX_PING (750)
Maximum server ping.

pawn Код:
#define USED_INTERIORS "1 2"
Used interiors separated by a space.

pawn Код:
#define MAX_SPEED (198)
Maximum vehicle speed.

pawn Код:
#define DRIVEBY_WEAPONS "28 29 32"
Driveby allowed weapons separated by a space.

pawn Код:
#define BUNNYHOP_AMOUNT (6)
Amount of jumps before it's called bunny hopping.

pawn Код:
#define CHATSPAM_LINES (4)
Amount of lines before it's called spam.

pawn Код:
#define AFK_MINUTES (10)
Amount of minutes before a person is AFK.

pawn Код:
#define SERVER_IP "127.0.0.1"
IP of your server.

pawn Код:
#define SERVER_DOMAIN "samp.servername.com"
Optional server domain.

pawn Код:
new CurseWords[][] = {"ass", "bitch", "shit", "fuck", "nigger", "cunt"};
List of all curse words.

pawn Код:
#define DETECT_KILLS (5)
Amount of kills in X seconds for spamkill detection

pawn Код:
#define DETECT_SECONDS (20)
Amount of seconds in X kills for spamkill detection


Security Levels and Toggling Cheats

At the top of the script you'll see a list of all of the cheats with a number next to them. The number next to the cheat is the security level required to bypass it. To disable an anticheat you can either comment the line for it or set the security level of it to 0. If you would like to require everyone to be checked by the detector for that cheat, you must set the security level to -1. Anything besides 0 and -1 will be it's required bypass security level. You can set a player's security level via svCheats_SetPlayerSecurityLevel. If the cheat's security level is 2 and my security level is 2 or above, then I won't be checked for the cheat but if my security level is below 2, I'll be checked for the cheat.


Optional Commands

There are two optional commands, /hh and /acstats. To disable any of them, comment one of the following:

pawn Код:
#define ACSTATS_USED

#define HH_USED (1)
The number after HH_USED specifies which security level can use the command.

/acstats displays the amount of cheaters detected by svCheats.


Bugs and Suggestions

Please reply to this thread with your bug report or suggestion for the include. All of these posts will be reviewed carefully and dealt with.


Versions

The download links and the include itself will be updated occasionally.

Version 1.8 - Pastebin | Mediafire | Assembla Direct Download
Version 1.7 - Pastebin | Mediafire | Assembla Direct Download
Version 1.6 - Pastebin | Mediafire | Assembla Direct Download
Version 1.5 - Pastebin | Mediafire | Assembla Direct Download
Version 1.4 - Pastebin | Mediafire | Assembla Direct Download
Version 1.3 - Pastebin | Mediafire | Assembla Direct Download
Version 1.2 - Pastebin | Mediafire
Version 1.1 - Pastebin | Mediafire
Version 1.0 - Pastebin | Mediafire



Don't want to wait for updates?

I'm currently uploading all of my changes to an Assembla account. Assembla will be updated before updates are released. If you wish to get the files directly from Assembla, use SVN Checkout with this URL: https://subversion.assembla.com/svn/sv-libraries/

My latest updates to Assembla are below:




Changelog

VersionChange
Version 1.8Added locked vehicle entering and spam kill detection
Version 1.8Improved settings design
Version 1.8Resolved a critical issue for users that didn't use the /hh command
Version 1.7Removed GAMEMODE definition, now uses FILTERSCRIPT definition
Version 1.6Resolved compiling issues
Version 1.5Resolved even more issues with fly hacking being detected upon swimming in certain areas (big thanks Kar)
Version 1.4Remote vehicle jack detection and invalid mod detection
Version 1.4Server advertisement, fake kill, and fake player detection
Version 1.4You no longer have to use svCheats_ToggleJetpack. It is done automatically and hooked on SetPlayerSpecialAction, ClearAnimations, and OnPlayerSpawn
Version 1.4Resolved an issue where the player would be detected as cheating sometimes when paused
Version 1.4Function natives have been added so that you can see the function parameters when you type 'functionName(' and pause for a little bit
Version 1.4Resolved an issue where the player would be detected as fly hacking when swimming a pool or past the Sherman Dam (full fix)
Version 1.3Added car ram, heliblade, and vehicle modification cheat detection
Version 1.3Resolved an issue where the player would be detected as health hacking when using ammunation or a sprunk machine
Version 1.3Resolved an issue where the player would be detected as weapon hacking when jumping out of an aircraft
Version 1.3Resolved an issue where the player would be detected as fly hacking when swimming in a pool
Version 1.2Resolved an issue where the player could be detected as bunny hopping when flying
Version 1.2Resolved an issue where the player could be detected as speed hacking when falling in a car
Version 1.2Better AFK detection (now detects position changes)
Version 1.2Users will no longer have to change GivePlayerWeapon and SetVehicleHealth in their script
Version 1.2Added health and armor hack detection
Version 1.1When a player swears, it will no longer automatically block the chat message
Version 1.1Resolved an issue where players couldn't talk if swearing detection was on
Version 1.1Resolved an issue where CHEAT_TABBED would be called for the player upon connecting
Version 1.1Added ninjajack detection
Version 1.1Added two optional commands, /acstats and /hh
Version 1.0Created the script

Using

To begin using this include, drag the file to your pawno > includes folder and put

pawn Код:
#include <svCheats>
at the top of your script.

Add the following code somewhere in your script:

pawn Код:
public svCheats_OnPlayerCheatUpdate(playerid, cheatid)
{
    switch(cheatid)
    {
        case CHEAT_HIGH_PING:
        {
        }

        case CHEAT_WEAPON_SPAWN:
        {
        }

        case CHEAT_SPEED_HACK:
        {
        }

        case CHEAT_JETPACK_HACK:
        {
        }

        case CHEAT_DRIVEBY:
        {
        }

        case CHEAT_DDRIVEBY:
        {
        }

        case CHEAT_SWEARING:
        {
        }

        case CHEAT_AIRBREAK_HACK:
        {
        }

        case CHEAT_BUNNYHOP:
        {
        }

        case CHEAT_FLY_HACK:
        {
        }

        case CHEAT_TELEPORT_HACK:
        {
        }

        case CHEAT_VEHICLE_REPAIR:
        {
        }

        case CHEAT_CHATSPAM:
        {
        }

        case CHEAT_AFK:
        {
        }

        case CHEAT_TABBED:
        {
        }

        case CHEAT_GODMODE:
        {
        }

        case CHEAT_NINJAJACK:
        {
        }

        case CHEAT_HEALTHHACK:
        {
        }

        case CHEAT_CARRAM:
        {
        }

        case CHEAT_HELIBLADE:
        {
        }

        case CHEAT_VEHMOD:
        {
        }

        case CHEAT_SERVERAD:
        {
        }

        case CHEAT_FAKEPLAYER:
        {
        }

        case CHEAT_FAKEKILL:
        {
        }

        case CHEAT_REMOTEJACK:
        {
        }

        case CHEAT_INVALIDMOD:
        {
        }

        case CHEAT_LOCKEDVEH:
        {
        }

        case CHEAT_SPAMKILL:
        {
        }
    }
    return 1;
}
If you have any filterscripts that set a player's health, armor, vehicle health, or give a player a weapon, you must have svCheats included in that script.


Credits

SuperViper - Creating the script
Cody Jones - Helping test the script
****** - foreach and y_hooks
Zeex - ZCMD


Re: svCheats - Server Protection - John_Cooper - 30.04.2012

Holy hell, this is great, mate.


Re: svCheats - Server Protection - Neil. - 30.04.2012

Quote:
Originally Posted by John_Cooper
Посмотреть сообщение
Holy hell, this is great, mate.
Thanks for this and seems easy to configure, i've been looking for something like this


Respuesta: svCheats - Server Protection - [Vector] - 30.04.2012

Lol, the script's name remembers me old times when I played Left 4 Dead.
By the way, Swearing, High ping, Bunnyhop, Chat spam, Alt tabbed and Afk are not cheats, this should be secondary features, but this shouldn't be in the cheat detected callback.
No offense Kalcor and Betatesters if you read this, but Map Andreas has several failures, it would be better if it works with some things like objects collisions.
I almost forget, the script is good, It's gonna be useful for me in some things. I gotta give you some rep for this.


Re: svCheats - Server Protection - SuperViper - 30.04.2012

Chat spam and swearing are not cheats but I felt like including them anyway. Everything else can be exploited to your advantage one way or another.


Re: svCheats - Server Protection - Dex007HLH - 01.05.2012

This is great! awesome job man!


Re: svCheats - Server Protection - Crazyboobs - 01.05.2012

How to disable a hack protection?


Re: svCheats - Server Protection - SuperViper - 01.05.2012

Comment the CHEAT_NAME line of the cheat, ex:

pawn Код:
//#define CHEAT_AFK (-1)



Re: svCheats - Server Protection - John_Cooper - 02.05.2012

Great to see a new version, keep 'em coming, mate.


Re: svCheats - Server Protection - SuperViper - 02.05.2012

Version 1.1 has been released. Check the changelog for all of the changes.


Re: svCheats - Server Protection - Juninho_Oakley - 02.05.2012

Nice


Re: svCheats - Server Protection - Crazyboobs - 02.05.2012

Theses are not enough.Can you add these functions?

Anti money hack
" health hack
" armour hack
" Vehicle spawn
" spam


Re: svCheats - Server Protection - Extremo - 02.05.2012

Hey,

Great work =)

Though I do have a question:

Why not use define's for this little issue here:
Код:
put 'svCheats_' before all of your GivePlayerWeapon and SetVehicleHealth lines
Since you already use so many defines you might as well just do this:

pawn Код:
#define OVERRIDE_NATIVES
#if defined OVERRIDE_NATIVES
    #define GivePlayerWeapon svCheats_GivePlayerWeapon
    #define SetVehicleHealth svCheats_SetVehicleHealth
#endif
Regards.


Re: svCheats - Server Protection - SuperViper - 02.05.2012

Quote:
Originally Posted by Crazyboobs
Посмотреть сообщение
Theses are not enough.Can you add these functions?

Anti money hack
" health hack
" armour hack
" Vehicle spawn
" spam
Spam is already detectable with CHEAT_CHATSPAM. Vehicle SPAWNING isn't possible. I'll consider making health and armor hack for v1.2.

Quote:
Originally Posted by Extremo
Посмотреть сообщение
Hey,

Great work =)

Though I do have a question:

Why not use define's for this little issue here:
Код:
put 'svCheats_' before all of your GivePlayerWeapon and SetVehicleHealth lines
Since you already use so many defines you might as well just do this:

pawn Код:
#define OVERRIDE_NATIVES
#if defined OVERRIDE_NATIVES
    #define GivePlayerWeapon svCheats_GivePlayerWeapon
    #define SetVehicleHealth svCheats_SetVehicleHealth
#endif
Regards.
I'll look into it for v1.2.


Re: svCheats - Server Protection - SpiderWalk - 02.05.2012

EXTRA!!!!!!


Re: svCheats - Server Protection - SuperViper - 03.05.2012

Version 1.2 has been released. Check the changelog for all of the changes.


Re: svCheats - Server Protection - Dude_Lebowski - 03.05.2012

OMG I love this it got everything !


Re: svCheats - Server Protection - Kar - 03.05.2012

Fly hacks is bugged, what if you swim in a pool at a house? or in pirates in men pants etc? Glen park pool?

You gotta exclude those :P


Re: svCheats - Server Protection - 4LiSs0N - 03.05.2012

Nice script


Re: svCheats - Server Protection - SuperViper - 03.05.2012

Quote:
Originally Posted by Kar
Посмотреть сообщение
Fly hacks is bugged, what if you swim in a pool at a house? or in pirates in men pants etc? Glen park pool?

You gotta exclude those :P
Will be done in version 1.3.

Quote:
Originally Posted by ******
Посмотреть сообщение
Something just struck me. The console command in quake/source based games to turn on cheats is "sv_cheats 1" (0 to disable them).
Haha, totally forgot about that. I don't use the console much.