Anti-cheat don't work ?
#1

hi guys ... i have a 'anti-cheat' in my FS but i don't know if it works ..

Above my script:
pawn Код:
#define LOG_FILE "TAP/log.txt"
#define MAX_STRING 256
#define MAX_SPAMTEXT 3

enum Info
{
    bool:Jetpack,
    bool:Spectating,
    bool:Weapon,
    bool:Money,
    bool:TextSpam,
    bool:CheckRCONFail,
    bool:Health,
    bool:Armor,
    bool:Bot,
    MaxPing
};

new Anticheat[Info];
new CurrCash[MAX_PLAYERS], Cash[MAX_PLAYERS];
new UltText[MAX_PLAYERS], SpamText[MAX_PLAYERS];

forward DetectCheat(playerid);
OnFilterscriptInit:
pawn Код:
Anticheat[Jetpack] = true; //Change true or false
    Anticheat[Spectating] = false; //Change true or false
    Anticheat[Weapon] = true; //Change true or false
    Anticheat[Money] = true; //Change true or false
    Anticheat[MaxPing] = 800; //Change 800 for max ping.
    Anticheat[TextSpam] = true; //Change true or false
    Anticheat[CheckRCONFail] = true; //Change true or false
    Anticheat[Health] = true; //Change true or false
    Anticheat[Armor] = true; //Change true or false
    Anticheat[Bot] = true; //Change true or false
And this at the bottum:

pawn Код:
public DetectCheat(playerid)
{
    if(Anticheat[Jetpack] == true)
    {
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
        {
            new str[MAX_STRING], strtofile[MAX_STRING];
            format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Jetpack)",PlayerName(playerid),playerid);
            format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Jetpack)",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_RED, str);
            SaveToFile(LOG_FILE, strtofile);
            Ban(playerid);
        }
    }
    if(Anticheat[Weapon] == true)
    {
        new weapon, ammo, str[MAX_STRING], strtofile[MAX_STRING];
        GetPlayerWeaponData(playerid, 7, weapon, ammo);
        if(weapon == 38)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Minigun)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Minigun)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }

        if(weapon == 36 || weapon == 35)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Rocket Launcher)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Rocket Launcher)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }
        if(weapon == 39)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Satchel Charge's)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Satchel Charge's)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }
    }
    if(Anticheat[Money] == true)
    {
        if(CurrCash[playerid] < GetPlayerMoney(playerid))
        {
            new str[MAX_STRING], strtofile[MAX_STRING];
            format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Money Hack)",PlayerName(playerid),playerid);
            format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Money Hack)",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_RED, str);
            SaveToFile(LOG_FILE, strtofile);
            Ban(playerid);
        }
    }
   
    if(GetPlayerPing(playerid) > Anticheat[MaxPing])
    {
        new str[MAX_STRING], strtofile[MAX_STRING];
        format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been kicked by System. (Reason: Max ping is %d)",PlayerName(playerid),playerid,Anticheat[MaxPing]);
        format(strtofile, sizeof(strtofile), "%s (%d) has been kicked by System. (Reason: Your ping is %d/%d (max)",PlayerName(playerid),playerid,GetPlayerPing(playerid),Anticheat[MaxPing]);
        SendClientMessageToAll(COLOR_RED, str);
        SaveToFile(LOG_FILE, strtofile);
        Kick(playerid);
    }
   
    if(Anticheat[Health] == true)
    {
        new Float:Healt;
        GetPlayerHealth(playerid, Healt);
        if(Healt > 100)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                new str[MAX_STRING], strtofile[MAX_STRING];
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Health Hacking)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Health Hacking)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }
    }
    if(Anticheat[Armor] == true)
    {
        new Float:Armour;
        GetPlayerArmour(playerid, Armour);
        if(Armour > 100)
        {
            new str[MAX_STRING], strtofile[MAX_STRING];
            format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Armour Hacking)",PlayerName(playerid),playerid);
            format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Armour Hacking)",PlayerName(playerid),playerid);
            SendClientMessageToAll(COLOR_RED, str);
            SaveToFile(LOG_FILE, strtofile);
            Ban(playerid);
        }
    }
    return 1;
}

stock PlayerName(playerid)
{ //By: AlexPoison11
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

stock SaveToFile(filename[],text[])
{ //By: Lethal, Modified: AlexPoison11
    new File:file, filepath[256], string[256], year,month,day, hour,minute,second;
    getdate(year,month,day); gettime(hour,minute,second);

    format(filepath,sizeof(filepath),"%s.txt",filename);
    file = fopen(filepath,io_append);
    format(string,sizeof(string),"[%d.%d.%d %d:%d:%d] %s\r\n",day,month,year,hour,minute,second,text);
    fwrite(file,string);
    fclose(file);

    return 1;
}

stock Anticheat_GivePlayerMoney(playerid, money)
{
    if(!IsPlayerConnected(playerid)) return 0;
    Cash[playerid] = amount;
    GivePlayerMoney(playerid, Cash[playerid]);
    CurrCash[playerid] = GetPlayerMoney(playerid);
    return 1;
}
I hope anyone can help me

I have tested it and i thinkg there was a hacker IG but he don't get banned ...
Reply
#2

what kind of thing he used?
jp? or hp ?
Reply
#3

Quote:
Originally Posted by Unknown1234
Посмотреть сообщение
what kind of thing he used?
jp? or hp ?
Thing ? xD And what you mean with jp and hp ?
Reply
#4

Jetpack or Health hack?
Reply
#5

Quote:
Originally Posted by Mean
Посмотреть сообщение
Jetpack or Health hack?
Ah lol ... the person who hacked had everything ... he had health hack + jetpack + airbrack...

And i tested the spamming too i typed 'test' 15 times after eachother xD And it don't work too ...
Reply
#6

pawn Код:
new weapon, ammo, str[MAX_STRING], strtofile[MAX_STRING];
        GetPlayerWeaponData(playerid, 7, weapon, ammo);
        if(weapon == 38)
Why not "if(GetPlayerWeapon(playerid) == 3"
Reply
#7

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
pawn Код:
new weapon, ammo, str[MAX_STRING], strtofile[MAX_STRING];
        GetPlayerWeaponData(playerid, 7, weapon, ammo);
        if(weapon == 38)
Why not "if(GetPlayerWeapon(playerid) == 3"
Like this then:
pawn Код:
if(Anticheat[Weapon] == true)
    {
        new str[MAX_STRING], strtofile[MAX_STRING];
        //GetPlayerWeaponData(playerid, 7, weapon, ammo);
        if(GetPlayerWeapon(playerid) == 38)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Minigun)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Minigun)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }

        if(GetPlayerWeapon(playerid) == 36 || GetPlayerWeapon(playerid) == 35)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Rocket Launcher)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Rocket Launcher)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }
        if(GetPlayerWeapon(playerid) == 39)
        {
            if(PlayerInfo[playerid][level] == 0)
            {
                format(str, sizeof(str), "[ANTICHEAT]: %s (%d) has been banned by System. (Reason: Satchel Charge's)",PlayerName(playerid),playerid);
                format(strtofile, sizeof(strtofile), "%s (%d) has been banned. (Reason: Satchel Charge's)",PlayerName(playerid),playerid);
                SendClientMessageToAll(COLOR_RED, str);
                SaveToFile(LOG_FILE, strtofile);
                Ban(playerid);
            }
        }
    }
Reply
#8

Yes!
But btw, with "== true" or "== false". It's just like IsPlayerAdmin.
'== true' can be like this: "if(Anticheat[Weapon])" en "== false" could be then "if(!Anticheat[Weapon])". I prefer that. You can do what you want off course. Your call.
Reply
#9

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
Yes!
But btw, with "== true" or "== false". It's just like IsPlayerAdmin.
'== true' can be like this: "if(Anticheat[Weapon])" en "== false" could be then "if(!Anticheat[Weapon])". I prefer that. You can do what you want off course. Your call.
mmm :S it's the same but yeah ... i can try it ofcourse ;p
Or else i need another Anti-cheat
Reply
#10

Quote:
Originally Posted by Michael@Belgium
Посмотреть сообщение
Or else i need another Anti-cheat
Nothing beats spectating!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)