GetClientIP: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 1: Line 1:
{{Server function}}
{{Server function}}
{{Deprecated}}
__NOTOC__
__NOTOC__
This function returns a string containing the IP address of the client.
This function returns a string containing the IP address of the client.

Revision as of 14:25, 27 March 2009

Emblem-important.png This function is deprecated. This means that its use is discouraged and that it might not exist in future versions, but there should be a more generic way to perform what it does.


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

Syntax

string getClientIP ( 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, command )
	outputChatBox ( getClientName ( thePlayer ) .. "'s IP is: " .. getClientIP ( thePlayer ) )
end
addCommandHandler ( "ip", printIP )

See Also

BEFORE VERSION 1.0 :