how can i make a ip limit ? pls help !
#10

Quote:
Originally Posted by Ceez
Посмотреть сообщение
Under the #define COLOR_X 0x...
under all those add
pawn Код:
#define MAX_CONNECTIONS_FROM_IP 3
pawn Код:
public OnPlayerConnect(playerid)
pawn Код:
// MAX IPS
    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: Connecting player(%d) exceeded %d IP connections from %s.", playerid, MAX_CONNECTIONS_FROM_IP, connecting_ip);
        SendClientMessage(playerid, COLOR_WHITE, "If you think its unfair ban, then appeal on forums.");
        format(string, sizeof(string), "AdmCmd: ID %d has been banned by MOLE, reason: exceeded IP-Connections limit", playerid);
        SendClientMessageToAll(COLOR_LIGHTRED, string);
        //Your ban code here
        return 1;
    }
+REP if I helped
You should hide the disconnect message & not use messages for it. That's just going to spam everyone which is the purpose of what they're doing.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)