if (strcmp("/getip", cmdtext, true, 10) == 0)
{
new str[128], name[MAX_PLAYER_NAME], IP[16];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerIp(playerid, IP, sizeof(IP));
format(str, sizeof(str), "Name: %s IP: %s.%s.%s.%s", name, IP);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Player's IP", str, "Exit", "");
return 1;
}
if (strcmp("/getip", cmdtext, true, 10) == 0)
{
new str[128], name[MAX_PLAYER_NAME], IP[16];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerIp(playerid, IP, sizeof(IP));
format(str, sizeof(str), "Name: %s IP: %s", name, IP);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Player's IP", str, "Exit", "");
return 1;
}
Luis no offense you can't explain for shit. What you meant is to ENTER in a IP and return all of the playerids that are with those IP.
Example : /ip 127.0.0.1 { It will return people in the server who has 127.0.0.1 } |
new
Array[512],
PIP[17];
format(Array, sizeof(Array), "Player:\t\tIP:\n");
foreach(Player, i)
{
new
IP = GetPlayerIp(i, PIP, sizeof(PIP));
format(Array, sizeof(Array), "%s\n%s(%d)\t\t%s\n", Array, pName(i), i, IP);
}
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_MSGBOX, "IPs", Array, "Ok", "Close");
stock pName(playerid)
{
new
Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
new
Array[512],
PIP[17];
format(Array, sizeof(Array), "Player:\t\tIP:\n");
foreach(Player, i)
{
new
IP = GetPlayerIp(i, PIP, sizeof(PIP));
format(Array, sizeof(Array), "%s\n%s(%d)\t\t%s\n", Array, pName(i), i, IP);
}
ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_MSGBOX, "IPs", Array, "Ok", "Close");