Larsey123IsMe
Unregistered
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");
}
}
}
}
Posts: 6,129
Threads: 36
Joined: Jan 2009
"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...
Larsey123IsMe
Unregistered
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");
}
}
}
Posts: 55
Threads: 1
Joined: Jan 2011
Reputation:
0
An NPC is something that you, the server owner, would have to make, what is the purpose in banning it?
Larsey123IsMe
Unregistered
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..
Posts: 6,129
Threads: 36
Joined: Jan 2009
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.
Larsey123IsMe
Unregistered
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