Przejdź do głównej zawartości

NetStats_GetIpPort

Description

Get a player's IP and port.

NameDescription
playeridThe ID of the player to get the IP and port of.
output[]A string array to store the IP and port in, passed by reference.
size = sizeof (output)The maximum length of the IP/port. 22 is recommended.

Returns

The player's IP and port is stored in the specified array.

Examples

public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/ipandport"))
{
new dest[22];
NetStats_GetIpPort(playerid, dest, sizeof(dest));

new szString[144];
format(szString, sizeof(szString), "Your current IP and port: %s.", dest);
SendClientMessage(playerid, -1, szString);
}
return 1;
}