Squirrel/Server/Functions/Players/IP

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '__NOTOC__ This function sets/returns the player's IP address. == Syntax == <code>string Player.IP</code> == Example == <code lang="squirrel"> function onPlayerCommand( pPlaye…')
 
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|Player.IP}}
This function sets/returns the player's IP address.
+
This ''Player'' class member returns the player's IP address.
  
 
== Syntax ==
 
== Syntax ==
  
 
<code>string Player.IP</code>
 
<code>string Player.IP</code>
 +
 +
== Arguments ==
 +
 +
* '''none'''
  
 
== Example ==
 
== Example ==
 +
 +
This command will display the player's IP address to them when they type '/ip'.
  
 
<code lang="squirrel">
 
<code lang="squirrel">
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
function onPlayerCommand( pPlayer, szCommand, szText )
 
{
 
{
if ( szCommand == "ip" )
+
    if ( szCommand == "ip" )
{
+
    {
MessagePlayer( "Your IP Address is " + pPlayer.IP, pPlayer );
+
          MessagePlayer( "Your IP Address is " + pPlayer.IP, pPlayer );
}
+
    }
 +
   
 +
    return 1;
 
}
 
}
 
</code>
 
</code>
 
  
 
=== Notes ===
 
=== Notes ===
  
The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] and [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] were used in in this example. More info about them in the corresponding page.
+
The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in the corresponding pages.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Players}}
 
{{Squirrel/Server/Functions/Players}}

Latest revision as of 23:48, 28 September 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This Player class member returns the player's IP address.

[edit] Syntax

  1. string Player.IP

[edit] Arguments

  • none

[edit] Example

This command will display the player's IP address to them when they type '/ip'.

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "ip" )
  5. {
  6. MessagePlayer( "Your IP Address is " + pPlayer.IP, pPlayer );
  7. }
  8. return 1;
  9. }
  10.  

[edit] Notes

The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding pages.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox