19.02.2012, 15:27
How to block multiple connections from same IP? If that is possible, how can I make it?
for (new i = 0; i != MAX_PLAYERS; ++i)
{
new connectingip[16], oldip[16];
GetPlayerIp(i, oldip, sizeof(oldip));
GetPlayerIp(playerid, connectingip, sizeof(connectingip));
if(connectingip[i] == oldip[playerid])
{
Kick(playerid);
}
}
new
ConnectedIP[MAX_PLAYERS][16];
public OnPlayerConnect(playerid)
{
new
p_IP[16],
g_IP[16]
;
GetPlayerIp(playerid, ConnectedIP[playerid], 16);
for ( new u; u < MAX_PLAYERS; u++ )
{
GetPlayerIp(u, g_IP, sizeof(g_IP));
if(g_IP[u] == p_IP[playerid])
{
//Multiple IPS! - Do something!
}
}
return 1;
}