[HELP]I Want To Build a Anti Cheat.
#3

Anti-Bot:
pawn Код:
#define MAX_BOTS 5
//Change MAX_BOTS to the amount of players MAXIMUM that can play on the same IP.

public OnPlayerConnect(playerid)
{
    new ip[15];
    new BotCount = 0;
    GetPlayerIp(playerid, ip, 15);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) //Foreach is a better option
        {
            if(i == playerid) continue;
            new playerip[15];
            GetPlayerIp(i, playerip, 15);
            if(strcmp(playerip, ip, true) == 0)
            {
                BotCount++;
                if(BotCount >= MAX_BOTS) return BanEx(i, "Bot Detected");
            }
        }
    }
    return 1;
}
//There may be better alternatives to this, but this is one I quickly scripted.
As for the anti-crasher anticheat, a great tutorial/script by JernejL works perfectly. I suggest you check it out.
https://sampforum.blast.hk/showthread.php?tid=317303
Reply


Messages In This Thread
[HELP]I Want To Build a Anti Cheat. - by ofekw2 - 31.01.2013, 04:25
Re: [HELP]I Want To Build a Anti Cheat. - by antonio112 - 31.01.2013, 06:51
Re: [HELP]I Want To Build a Anti Cheat. - by Threshold - 31.01.2013, 07:17
Re: [HELP]I Want To Build a Anti Cheat. - by ofekw2 - 31.01.2013, 11:26

Forum Jump:


Users browsing this thread: 1 Guest(s)