GetClientIP

From Multi Theft Auto: Wiki
Revision as of 14:14, 15 August 2007 by Arc (talk | contribs) (addCommandHandler placed after function declaration. Second argument changed from string to function pointer)
Jump to navigation Jump to search

This function returns a string containing the IP 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 :