[HELP] Good or Stupid way to detect bots?
#1

pawn Код:
//On Top
forward AntiBot();

//OnGameModeInit
SetTimer("AntiBot", 150000, 1);

//Any Where
public AntiBot()
{
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(GetPlayerPing(i) < 1)
            {
                new name[MAX_PLAYER_NAME], string[128];
                GetPlayerName(i, name, sizeof(name));
                BanEx(i, "Bot");
            }
        }
    }
}
Reply
#2

"Stupid way."

If you're trying to get rid of NPCs, they don't return a ping, use IsPlayerNPC. As for bots that just connect and idle, then they're going to have a ping and it will be higher than 1...
Reply
#3

Thanks and you mean something like this? xD

pawn Код:
//Any Where
public AntiBot()
{
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerNPC(i))
        {
            new name[MAX_PLAYER_NAME], string[128];
            GetPlayerName(i, name, sizeof(name));
            BanEx(i, "Bot");
        }
    }
}
Reply
#4

An NPC is something that you, the server owner, would have to make, what is the purpose in banning it?
Reply
#5

Quote:
Originally Posted by Gabe
Посмотреть сообщение
An NPC is something that you, the server owner, would have to make, what is the purpose in banning it?
Emm, i heard someone got attacked by "Bots" so i searched for "Anti bot" and i found a script amlost like mine. ect ect..
Reply
#6

Quote:
Originally Posted by Larsey123IsMe
Посмотреть сообщение
Emm, i heard someone got attacked by "Bots" so i searched for "Anti bot" and i found a script amlost like mine. ect ect..
They wouldn't be deemed as NPCs and there's no way 100% foolproof way of detecting whether a player is a bot or not.
Reply
#7

Quote:
Originally Posted by Calgon
Посмотреть сообщение
They wouldn't be deemed as NPCs and there's no way 100% foolproof way of detecting whether a player is a bot or not.
ok it was a stupid question, nvm then.

Tpoic: Closed
Reason: nvm
Dont post more here xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)