getPlayerIP | Multi Theft Auto: Wiki Skip to content

getPlayerIP

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns a string containing the IP address of the player.

OOP Syntax Help! I don't understand this!

  • Method:player:getIP(...)
  • Variable: .ip

Syntax

string getPlayerIP ( player thePlayer )
Required Arguments
  • thePlayer: The player element you want to get the IP of.

Returns

  • string: value

Returns a string containing the requested players's IP, or false if the player passed to the function is invalid.

Code Examples

shared

This example prints a player's IP to the chat.

function printIp ( thePlayer )
outputChatBox ( "IP: " .. getPlayerIP ( thePlayer ), thePlayer )
end
addCommandHandler ( "ip", printIp )

See Also