Player.IPAddress
From GMod Wiki
Function | |
Syntax | Player:IPAddress( ) |
Description: | |
Returns the player's IP-address | |
Returns: | String |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.IPAddress]Player.IPAddress [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Prints the player's IP Address to their console. |
---|---|
Used on | |
Code | function PrintIP( ply ) ply:PrintMessage(HUD_PRINTCONSOLE, "My IP Address: "..ply:IPAddress()) end |
Output | N/A |
Additional Notes
- Always returns "loopback" in singleplayer
- Bots will always return "Error!"
- Includes port of client in normal format (x.x.x.x:xxxx)