Squirrel/Server/Functions/Players/IP
From Liberty Unleashed Wiki
(Difference between revisions)
(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: | ||
− | + | {{Squirrel/Title|Player.IP}} | |
− | This | + | 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" ) | |
− | + | { | |
− | + | MessagePlayer( "Your IP Address is " + pPlayer.IP, pPlayer ); | |
− | + | } | |
+ | |||
+ | return 1; | ||
} | } | ||
</code> | </code> | ||
− | |||
=== Notes === | === Notes === | ||
− | The | + | 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
This Player class member returns the player's IP address.
[edit] Syntax
string Player.IP
[edit] Arguments
- none
[edit] Example
This command will display the player's IP address to them when they type '/ip'.
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "ip" ) { MessagePlayer( "Your IP Address is " + pPlayer.IP, pPlayer ); } return 1; }
[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
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState