Command that detects player's same IP?
#3

If you mean a list of the players with the current IP address that are currently connected you can loop through players, compare their IP and handle it accordingly. If you mean account-wise, I'd recommend the usage of MySQL for your accounts so you can simply perform a query(considering you have an "IP" column storing the IP address of the account).

For the first:
pawn Код:
CMD:ip(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(isnull(params))
            return SendClientMessage(playerid, -1, "USAGE: /ip [IP]");
           
        new pIP[32], playerIP[32], string[32];
        for(new i; i < MAX_PLAYERS; i++)
        {
            if(!IsPlayerConnected(i)) continue;
           
            GetPlayerIp(playerid, playerIP, sizeof playerIP);
            if(!strcmp(pIP, playerIP))
            {
                format(string, sizeof string, "%s, %d", string, playerid);
            }
        }
       
        SendClientMessage(playerid, -1, string);
    }

    return 1;
}
Reply


Messages In This Thread
Command that detects player's same IP? - by D1am0nd - 09.11.2015, 19:33
AW: Command that detects player's same IP? - by BiosMarcel - 09.11.2015, 20:29
Re: Command that detects player's same IP? - by Abagail - 09.11.2015, 20:32
Re: Command that detects player's same IP? - by jeffery30162 - 10.11.2015, 13:46

Forum Jump:


Users browsing this thread: 1 Guest(s)