GetPlayerIP

From Multi Theft Auto: Wiki
Revision as of 14:04, 5 February 2009 by Sebassje (talk | contribs) (New page: {{Server function}} __NOTOC__ This function returns a string containing the IP address of the client. ==Syntax== <syntaxhighlight lang="lua"> string getPlayerIP ( client theClient ) </syntaxhighlight> ===Required...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Syntax

string getPlayerIP ( client theClient )

Required Arguments

  • theClient: The client element (player or admin) you want to get the IP of.

Returns

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

Example

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

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

addCommandHandler("ip", printIp)

See Also