31.01.2013, 07:17
Anti-Bot:
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
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.
https://sampforum.blast.hk/showthread.php?tid=317303