20.07.2012, 14:20
Coloque isso em:
Final do GM:
Funcionou comigo.
pawn Код:
//Topo do GM//
#define MAX_CONNECTIONS_FROM_IP 2
pawn Код:
//OnPlayerConnect
// Anti-BOT //
new connecting_ip[32+1];
GetPlayerIp(playerid,connecting_ip,32);
new num_players_on_ip = GetNumberOfPlayersOnThisIP(connecting_ip);
if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP) {
printf("MAXIPs: Coneccoes (%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
Kick(playerid);
return 0;
}
if(strcmp(connecting_ip,"255.255.255.255",true)==0)
{
Ban(playerid);
return 0;
}
// Fim do anti-BOT //
pawn Код:
stock GetNumberOfPlayersOnThisIP(test_ip[])
{
new against_ip[32+1];
new xxx = 0;
new ip_count = 0;
for(xxx=0; xxx<MAX_PLAYERS; xxx++) {
if(IsPlayerConnected(xxx)) {
GetPlayerIp(xxx,against_ip,32);
if(!strcmp(against_ip,test_ip)) ip_count++;
}
}
return ip_count;
}