Squirrel/Client/Functions/Players/Pos
From Liberty Unleashed Wiki
(Difference between revisions)
IdkanYavuk (Talk | contribs) (→Example 1. Returning) |
IdkanYavuk (Talk | contribs) (→Example 1. Returning) |
||
Line 23: | Line 23: | ||
local plr = FindLocalPlayer(); | local plr = FindLocalPlayer(); | ||
local v = plr.Pos; | local v = plr.Pos; | ||
− | MessagePlayer( plr.Name + " | + | MessagePlayer( plr.Name + " is in x=" + v.x + ", y=" + v.y + ", z=" + v.z ); |
return true; | return true; |
Latest revision as of 16:44, 11 October 2012
This Player class member returns or sets the position of the given player. Note that setting will only affect the local player.
[edit] Syntax
You can either return or set a new value using this member:
Vector Player.Pos
Player.Pos = Vector pos
[edit] Arguments
- pos - This is the new position for the player as a Vector
[edit] Example 1. Returning
This command returns the player position
function onClientCommand( cmd, args ) { if ( cmd == "mypos" ) { local plr = FindLocalPlayer(); local v = plr.Pos; MessagePlayer( plr.Name + " is in x=" + v.x + ", y=" + v.y + ", z=" + v.z ); return true; } }
[edit] Notes
-- List of used functions and other notes here.
[edit] Example 2. Setting
This function needs an example. You can help us complete the wiki by writing one, or maybe even more :o
Some explanation here too
-- todo
[edit] Notes
-- List of used functions and other notes here.
[edit] Related Functions
- FindLocalPlayer
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.Colour
- Player.Frozen
- Player.Health
- Player.ID
- Player.Immune
- Player.Island
- Player.Marker
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLimb
- Player.Score
- Player.Skin
- Player.Spawn
- Player.Team
- Player.Train
- Player.Vehicle
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.WeaponAmmo
- Player.WeaponState