Player::ip: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This property returns players ip adress. '''Note: this property is read-only.''' == Example == <source lang="javascript"> let playerIP = player.ip </source>")
 
No edit summary
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This property returns players ip adress.
This property returns the player's IP address.


'''Note: this property is read-only.'''
'''Note: this property is read-only.'''
== Getter ==
* {{RageType|string}} The player's IP Address
== Example ==
== Example ==
<source lang="javascript">
{{ServersideCode|
let playerIP = player.ip
<pre>
</source>
const player = mp.players.at(0);
 
const playerIP = player.ip;
player.outputChatBox("Your IP is: " + playerIP);
</pre>
}}
 
==See Also==
{{Player_block}}
 
[[Category:Player API]]
[[Category:Server-side Property]]

Latest revision as of 05:28, 31 May 2019

This property returns the player's IP address.

Note: this property is read-only.

Getter

  • string The player's IP Address

Example

Server-Side
const player = mp.players.at(0);

const playerIP = player.ip;
player.outputChatBox("Your IP is: " + playerIP);

See Also