Scripting/Squirrel/Functions/Player.IP: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
No edit summary
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Scripting/Needs_Text}}
This instance variable returns player's IP address.


== Syntax ==
== Syntax ==


<pre>player.IP</pre>
<pre>string player.IP</pre>
 
== Example ==
== Example ==
<source lang=squirrel>
<source lang=squirrel>
function OnPlayerCommand( player , cmd , text )
function OnPlayerCommand( player , cmd , text )
    if ( cmd == "myip" )
{
    {
if ( cmd == "myip" ) MessagePlayer( " Your IP is " + player.IP , player );
    MessagePlayer( " Your IP is " + player.IP , player );
}
    }


</source>
</source>


=== Notes ===
=== Notes ===
Call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in this example. More info about them in the corresponding pages.
 
The functions [[Scripting/Squirrel/Functions/MessagePlayer|MessagePlayer]], [[Scripting/Squirrel/Functions/Player.Name|Player.Name]] and call [[Scripting/Squirrel/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in corresponding pages.
 
== Related Functions ==
 
{{Scripting/Squirrel/Functions/Player_Functions}}
[[Category:Scripting/Squirrel/Functions/Player_Functions]]

Latest revision as of 18:49, 30 January 2017

This instance variable returns player's IP address.

Syntax

string player.IP

Example

function OnPlayerCommand( player , cmd , text )
{
	if ( cmd == "myip" ) MessagePlayer( " Your IP is " + player.IP , player );
}

Notes

The functions MessagePlayer, Player.Name and call onPlayerCommand were used in in this example. More info about them in corresponding pages.

Related Functions

Player Game Functions

These functions exist for compatibility with the R2 Squirrel server.