[HELP] Good or Stupid way to detect bots? - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Good or Stupid way to detect bots? (
/showthread.php?tid=217456)
[HELP] Good or Stupid way to detect bots? - Larsey123IsMe - 28.01.2011
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");
}
}
}
}
Re: [HELP] Good or Stupid way to detect bots? -
Calgon - 28.01.2011
"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...
Re: [HELP] Good or Stupid way to detect bots? - Larsey123IsMe - 28.01.2011
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");
}
}
}
Re: [HELP] Good or Stupid way to detect bots? -
Gabe - 28.01.2011
An NPC is something that you, the server owner, would have to make, what is the purpose in banning it?
Re: [HELP] Good or Stupid way to detect bots? - Larsey123IsMe - 28.01.2011
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..
Re: [HELP] Good or Stupid way to detect bots? -
Calgon - 28.01.2011
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.
Re: [HELP] Good or Stupid way to detect bots? - Larsey123IsMe - 28.01.2011
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