SA-MP Forums Archive
[Include] Anti-Cheat system v0.1 - 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] Anti-Cheat system v0.1 (/showthread.php?tid=514743)



Anti-Cheat system v0.1 - Swedky - 23.05.2014

Quote:
  • Changelog:
    • v0.1 released.
Introduction:

Callbacks:
pawn Код:
public OnPlayerHackDetected(playerid, hacktype, oldvalue, newvalue)

/* - hacktype

CHEAT_WEAPON    0
CHEAT_MONEY     1
CHEAT_VEHMOD    2
CHEAT_******    3 // s0b3it.

*/

Functions:
pawn Код:
native SetPlayerReliable(playerid, bool:reliable); // We can establish that a player is reliable (As a NPC or an admin).
native SetSuspectToPlayer(playerid, bool:suspect); // Or no... (PS: the same include will add values to these functions).

native IsPlayerReliable(playerid);
native IsPlayerSuspect(playerid);
native GetPlayerWarnings(playerid); // This will return the quantity of warnings of "possible cheat" that the have player.


Example:
pawn Код:
#include <Anti_Cheat>
#include <YSI\y_iterate>


public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) SetPlayerReliable(playerid, true);
    else SetPlayerReliable(playerid, false);
    return 1;
}


public OnPlayerCheatDetected(playerid, cheattype, oldvalue, newvalue)
{
    if(GetPlayerWarnings(playerid) == 5) return SendClientMessage(playerid, -1, "* Good-bye."), Ban(playerid);

    switch(cheattype)
    {
        case CHEAT_WEAPON:
        {
            SendClientMessage(playerid, 0xFF0000AA, "* Hey, here not!");
            GivePlayerWeapon(playerid, oldvalue, 10); // Give original weapon.
        }
        case CHEAT_MONEY:
        {
            new string[128];
            new Nick[MAX_PLAYER_NAME];

            GetPlayerName(playerid, Nick, sizeof(Nick));
            format(string, sizeof(string), "* %s[%d] Possible Money-Hack - [$%i -> $%i = +$%i].", Nick, playerid, oldvalue, newvalue, (newvalue-oldvalue));
            foreach(new i: Player)
            {
                if(IsPlayerAdmin(i)) SendClientMessage(i, -1, string);
            }
        }
    }
    return 1;
}


Notes:


Future versions:


Download:


Credits:


If you have ideas or suggestions, don't hesitate in say me!
- Regards.


Re: Anti-Cheat system v0.1 - Team_PRO - 23.05.2014

im waiting for anti-bot and godmode and add anti bunny hop


Respuesta: Anti-Cheat system v0.1 - Swedky - 23.05.2014

Oh thank you, I'll bear it in mind


Re: Anti-Cheat system v0.1 - VenomMancer - 24.05.2014

works ?