Ко всем new:
Код
new ConnectTimed[MAX_PLAYERS];
new IsConnected[MAX_PLAYERS char];
В public OnFilterScriptInit() добавляем:
Код
for(new i = 0; i < MAX_PLAYERS; i++)
{
ConnectTimed[i] = 0;
IsConnected{i} = 0;
}
В public OnFilterScriptExit() добавляем:
Код
for(new i = 0; i < MAX_PLAYERS; i++)
{
ConnectTimed[i] = 0;
IsConnected{i} = 0;
}
В public OnPlayerConnect(playerid) добавляем:
Код
if((GetTickCount() - ConnectTimed[playerid]) <= 500) return BanEx(playerid,"MainProtectBot");
ConnectTimed[playerid] = GetTickCount();
if(IsConnected{playerid} == 2)return BanEx(playerid,"BotProtect");
IsConnected{playerid} += 1;
new ip[2][16];
GetPlayerIp(playerid,ip[0],16);
for(new i, m = GetMaxPlayers(), x; i != m; i++)
{
if(!IsPlayerConnected(i) || i == playerid) continue;
GetPlayerIp(i,ip[1],16);
if(!strcmp(ip[0],ip[1],true)) x++;
if(x > 2) return Kick(i),print("Kick Bot");
}
В public OnPlayerDisconnect(playerid, reason) добавляем:
Код
IsConnected{playerid} = 0;