28.01.2018, 14:16
one method is to check their IP and then set a limit,
lets suppose
lets suppose
Код:
#define MAX_CONNECTIONS_FROM_IP 5
new pip[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
GetPlayerIp(playerid,pip[playerid],16);
new num_players_on_ip = GetNumberOfPlayersOnThisIP(pip[playerid]);
if(num_players_on_ip > MAX_CONNECTIONS_FROM_IP)
{
Kick( playerid );
return 1;
}
}
stock GetNumberOfPlayersOnThisIP(test_ip[])
{
new ip_count;
for(new i;i<MAX_PLAYERS;i++)
{
if(!strcmp(pip[i],test_ip)) ip_count++;
return ip_count;
}
}

