Retrieves the IP address of a PC.
- The players who's IP address will be returned.
Returns the IP address from which oPlayer has connected to the server. Returns a blank string on error or if in singleplayer.
In NWN:EE you can now use GetObjectUUID to get a more unique reference for individual characters a player uses if required.
If this command is used on a Player that is using the same IP address as the server (such as self-hosting or in singleplayer), then the IP Address Returned will be an empty string ("")
Not a bug, but a caveat. OnClientLeave, the PC object (GetExitingObject) is still valid, but the player object (i.e. the human being logged into the server) is not. This means that there are a few things you can't do OnClientLeave. Namely, the GetPCPlayerName, GetPCIPAddress, and GetPCPublicCDKey will not work, since the player is no longer around to get that information from. This can be worked around by storing them as local strings on the PC, for instance OnClientEnter. See workaround below.
SetLocalString(oPC, "player_name", sPlayerName);
SetLocalString(oPC, "player_ip", sIP);
SetLocalString(oPC, "player_cdkey", sKey);
|functions:||GetPCPlayerName GetPCPublicCDKey GetObjectUUID|
author: Sarev0k, editor: Lilac Soul, additional contributor(s): Lilac Soul