GetPlayerIP: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{Server function}}
{{Server function}}
__NOTOC__
This function returns a [[string]] containing the IP address of the [[player]].
This function returns a [[string]] containing the IP address of the [[player]].


Line 7: Line 7:
string getPlayerIP ( player thePlayer )
string getPlayerIP ( player thePlayer )
</syntaxhighlight>
</syntaxhighlight>
 
{{OOP||[[player]]:getIP|ip|}}
===Required Arguments===
===Required Arguments===
* '''thePlayer:''' The [[player]] element you want to get the IP of.
* '''thePlayer:''' The [[player]] element you want to get the IP of.
Line 24: Line 24:


==See Also==
==See Also==
{{Player functions}}
{{Player functions|server}}
 
[[de:getPlayerIP]]
[[ru:getPlayerIP]]

Latest revision as of 22:42, 6 September 2024

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

Syntax

string getPlayerIP ( player thePlayer )

OOP Syntax Help! I don't understand this!

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


Required Arguments

  • thePlayer: The player element you want to get the IP of.

Returns

Returns a string containing the requested players's IP, or false if the player 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