[Include] FairPlay - Keep the cheaters out
#1

I DON'T CODE FOR/PLAY SAMP ANYMORE, THIS IS PROBABLY VERY BUGGY AND WILL NOT WORK. DO NOT EXPECT ANY UPDATES.




Introduction

FairPlay will help you get rid of the cheaters on your server. I designed it to be easy to use while still being very effective. While it may not detect everything to the fullest extent, it won't give you any false positives.


Required Libraries

To use FairPlay, you must be running sscanf version 2 on your server. If you currently do not have sscanf, you may download it here: https://sampforum.blast.hk/showthread.php?tid=120356


Staff Member Immunity

You might be wondering how to prevent your staff members from getting detected by FairPlay. Well it's simple. You can use the custom SetPlayerFairPlayImmune function after stats are loaded to make a player immune to FairPlay detection.

Example:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(playerStaffLevel[playerid])
    {
        SetPlayerFairPlayImmune(playerid, 1);
    }

    return 1;
}
Of course you will need to change the playerStaffLevel variable in that example to fit your needs, but you get the point.


Including

To add FairPlay to your script you must download FairPlay.inc and place it in your pawno => include folder. Once you have placed the file in the correct folder, you must add

pawn Код:
#include <FairPlay>
to the top of your script.

If you are using this in a gamemode, you must put

pawn Код:
#define FP_MASTER
before including FairPlay.


After Including

After including FairPlay into your script, you will need to add the following callback somewhere in your script:

pawn Код:
public OnPlayerUnfairPlay(playerid, playType)
{
    switch(playType)
    {
        case FP_HIGH_PING:
        {
        }

        case FP_WEAPON_HACK:
        {
        }

        case FP_VEHICLE_SPEED_HACK:
        {
        }

        case FP_JETPACK_HACK:
        {
        }

        case FP_SWEARING:
        {
        }

        case FP_FLY_HACK:
        {
        }

        case FP_CHAT_SPAM:
        {
        }

        case FP_AFK:
        {
        }

        case FP_TABBING:
        {
        }

        case FP_NINJA_JACK:
        {
        }

        case FP_CAR_RAM:
        {
        }

        case FP_HELIBLADE:
        {
        }

        case FP_VEHICLE_MOD_HACK:
        {
        }

        case FP_SERVER_AD:
        {
        }

        case FP_FAKE_KILL:
        {
        }

        case FP_TELEPORT_HACK:
        {
        }
    }

    return 1;
}
Every time unfair play is detected, that callback will be called. playerid is the player who is playing unfairly and playType is what the player is doing that is unfair.


Possible playType Values

This is a list of all possible values that playType can be along with a description of when it's called.

playTypeDescription
FP_HIGH_PINGWhen the player has reached 3 warnings for having a ping above FP_MAX_PING
FP_WEAPON_HACKWhen the player fires a weapon that was not given to them from the script
FP_VEHICLE_SPEED_HACKWhen a vehicle passes it's speed limit
FP_JETPACK_HACKWhen the player has a jetpack which was not given to them from the script
FP_DRIVER_DRIVEBY*Preventing driver drivebys
FP_DRIVEBY_WEAPONS_RESTRICT*Restricting driveby weapons to the ones specified in FP_DRIVEBY_WEAPONS
FP_SWEARING**When a player says a word that is defined in FP_CurseWords either in a command or in the chat
FP_FLY_HACKWhen a player is flying
FP_CHAT_SPAMWhen a player spams the chat or commands in a short period of time
FP_AFKWhen a player hasn't said anything in the chat, used a command, or moved in 5 minutes
FP_TABBINGWhen a player is tabbed out of the game
FP_NINJA_JACKWhen a player jacks a vehicle from another player in a certain way which results in the original driver dying
FP_CAR_RAMWhen a player rams another player with a vehicle
FP_HELIBLADEWhen a player kills another player using the blades of his helicopter
FP_VEHICLE_MOD_HACKWhen a player modifies their vehicle outside of a tuning garage
FP_SERVER_AD***When a player says a server's IP or domain in chat or a command and the IP and/or domain don't correspond to FP_SERVER_IP and FP_SERVER_DOMAIN
FP_FAKE_KILLWhen a player uses a cheat to fake a kill by another player
FP_TELEPORT_HACKWhen a player teleports to a far away location
* = Will not be called in OnPlayerUnfairPlay
** = Curse words are automatically converted to * characters
*** = Messages with server advertisements will not be sent


Avoiding Filterscript Conflicts

In order to avoid conflicts with other filterscripts forcing FairPlay to give off false positives, you must include this in all loaded filterscripts.


Settings

If you would like to disable detection for anything, you may comment out the line of where the playType is defined.

For example, if you would like to disable checking tabbed players, you would comment out the following line:

pawn Код:
#define FP_TABBING (11)
There are also some settings that you can change under all of the unfair play definitions.

FP_TIMER_INTERVAL: This is the interval at which the per-player timer will repeat itself. It is recommended that you do not change this unless you know what you are doing.

FP_MAX_PING: This is the maximum amount of ping a user may have before a ping warning is given to them.

FP_DRIVEBY_WEAPONS: These are the weapons (separated with a space) with which a user can driveby with.

FP_SERVER_IP: This is your server IP.

FP_SERVER_DOMAIN: This is your server domain.

FP_CurseWords: This is a list of words (separated by a comma) which are censored and reported as swearing when said.


Issues and Suggestions

If you happen to find an issue with FairPlay or would like to suggest a new feature or to change an existing feature, please reply to this thread with your request and I will get to it shortly.


Download

Version 1.2: Pastebin - Mediafire - Puush
Version 1.1: Pastebin - Mediafire - Puush
Version 1.0: Pastebin - Mediafire - Puush



Changelog

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Version 1.2 (critical update) has been released:
- Added another method to fake kill detection
- Resolved a critical issue with vehicle speed hack detection in airplanes
- Resolved a minor issue in which a player surfing a vehicle may get detected as teleporting in a rare case
Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Version 1.1 has been released:
- Messages that contain server advertisements are now automatically not sent
- Fake kill now ignores NPCs
- Master/slave functionality
Gamemodes must have
pawn Код:
#define FP_MASTER
before including FairPlay
Credits

Scripting: SuperViper/Ricky Phelps
Testing: Chriham3/Alex Shock
Reply


Messages In This Thread
FairPlay - Keep the cheaters out - by SuperViper - 06.07.2013, 23:08
Re: FairPlay - Keep the cheaters out - by Chriham3 - 06.07.2013, 23:20
Re: FairPlay - Keep the cheaters out - by Josh Slice - 06.07.2013, 23:21
Re: FairPlay - Keep the cheaters out - by Stylock - 07.07.2013, 00:27
Re: FairPlay - Keep the cheaters out - by Pottus - 07.07.2013, 00:42
Re: FairPlay - Keep the cheaters out - by SuperViper - 07.07.2013, 00:51
Re: FairPlay - Keep the cheaters out - by Pottus - 07.07.2013, 01:24
Re: FairPlay - Keep the cheaters out - by SuperViper - 07.07.2013, 02:26
Re: FairPlay - Keep the cheaters out - by Pottus - 07.07.2013, 02:39
Re: FairPlay - Keep the cheaters out - by Donvalley - 07.07.2013, 04:05

Forum Jump:


Users browsing this thread: 2 Guest(s)