Player.Pos

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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:

  1. Vector Player.Pos
  1. 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

  1.  
  2. function onClientCommand( cmd, args )
  3. {
  4. if ( cmd == "mypos" )
  5. {
  6. local plr = FindLocalPlayer();
  7. local v = plr.Pos;
  8. MessagePlayer( plr.Name + " is in x=" + v.x + ", y=" + v.y + ", z=" + v.z );
  9. return true;
  10. }
  11. }
  12.  

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

  1.  
  2. -- todo
  3.  

Notes

-- List of used functions and other notes here.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox