09.11.2015, 20:32
(
Последний раз редактировалось Abagail; 09.11.2015 в 21:10.
)
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:
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;
}