12.01.2019, 18:01
Quote:
You could get the IP of the person you've just banned, run a foreach loop through all the players, compare if they have the same IP of the person you've just banned and if so kick them/ban them do whatever.
|
Код:
// Get InterIP - Slice stock GetIntegerIP(const input[]) { new ip = 0, pos = -1; for (new i = 24; i >= 0; i -= 8) { ip |= strval(input[++pos]) << i; if (i) { pos = strfind(input, ".", _, pos); } } return ip; }
Код:
new LongIP[MAX_PLAYERS]; OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); LongIP[playerid] = GetIntegerIP(plrIP); ... OnPlayerDisconnect(playerid) { LongIP[playerid] = 0; ...