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 17: | Line 17: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onClientCommand( cmd, args ) |
{ | { | ||
if ( cmd == "mypos" ) | if ( cmd == "mypos" ) |
Revision as of 16:43, 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.
Syntax
You can either return or set a new value using this member:
Vector Player.Pos
Player.Pos = Vector pos
Arguments
- pos - This is the new position for the player as a Vector
Example 1. Returning
This command returns the player position
function onClientCommand( cmd, args ) { if ( cmd == "mypos" ) { local v = plr.Pos; MessagePlayer( plr.Name + " esta en x=" + v.x + ", y=" + v.y + ", z=" + v.z , plr ); return true; } }
Notes
-- List of used functions and other notes here.
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
Notes
-- List of used functions and other notes here.
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