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
(Created page with "== Syntax == <pre>player.IP</pre> == Example == <source lang=squirrel> if ( cmd == "myip" ) { MessagePlayer( " Your IP is " player.IP , player ); } </source...")
 
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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>
    if ( cmd == "myip" )
function OnPlayerCommand( player , cmd , text )
    {
{
    MessagePlayer( " Your IP is " player.IP , player );
if ( cmd == "myip" ) 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.