How can i make a command that check all players IPs online in my server, and find the players that has the /getip IP_EXAMPLE ?
Ex.
Код:
COMMAND:getip(playerid, params[])
{
new ip[20], rst = -1;
for(new i=0, j=GetPlayerPoolSize(); i<=j; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerIp(i, ip, sizeof(ip));
if(!strcmp(ip, params, true))
{
rst = i;
break;
}
}
}
if(rst == -1) return SendClientMessage(playerid, -1, "No player found");
new string[100];
new name[MAX_PLAYER_NAME];
GetPlayerName(rst, name, sizeof(name));
formt(string, sizeof(string), "%s(%d) has the IP: %s", name, rst, params);
SendClientMessage(playerid, -1, string);
return 1;
}