How to detect Bots by FilesMaker - 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)
+--- Thread: How to detect Bots by FilesMaker (
/showthread.php?tid=495864)
How to detect Bots by FilesMaker -
FilesMAker - 19.02.2014
When i was fixing my scripts, i remark that BOT when it join, the server don't make his file. After I check my scripts i found that BOTS skip all dialogs, like register and login dialog.
Then I make a variable on the player info enum with name "ACCEPTED", and i put when a player type the password on the registering menu or login dialog, this accepted variable take the value 1.
Finally on OnPlayerRequestSpawn() I add a condition if that accepted variable don't take 1 the server kick the player that is supposed to BOT.
Tested with : RakSAMPClient Bot Sytem.
Please test with other Bots generator if it works +1 rep please !
Re: How to detect Bots by FilesMaker -
Kyance - 19.02.2014
Credits to Konstantinos
pawn Код:
stock IsNameWithTag( const szName[ ] )
{
if( !szName[ 0 ] ) return 0;
new
tag1 = strfind( szName, "[B" ), //Will detect [B
tag2 = strfind( szName, "T]" ) //Will detect T], so [BoT] will be detected.
;
return ( tag1 == 0 && tag2 != strlen( szName ) - 1 ) ? 1 : 0;
}
//OnPlayerConnect
new
sz_Name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, sz_Name, MAX_PLAYER_NAME );
if( IsNameWithTag( sz_Name ) )
{
SetTimerEx("BanTimer", 100, false, "i", playerid);
SendClientMessage(playerid, COLOR_RED, "[ANTI-CHEAT] - You've been AUTO-Banned for being a possible BOT user!");
}
//rest of OnPlayerConnect script(s) here
//BanTimer
forward BanTimer(playerid);
public BanTimer(playerid)
{
Ban(playerid);
return 1;
}
Hackers can ofc. re-name their both.
Try getting a players IP OnPlayerConnect, and if someone connects w/ the same IP 2 or 3 times, then he's a bot sender xd
Re: How to detect Bots by FilesMaker -
FilesMAker - 19.02.2014
That control just Name, but my remark was that bots skip all dialogs, then spawn !
It join without login or registering, that is my remark !
Re: How to detect Bots by FilesMaker -
FilesMAker - 24.02.2014
This or My method works well with my server, test it on yours !!