Squirrel/Client/Functions/Players/Pos

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example 1. Returning)
(Example 1. Returning)
 
Line 23: Line 23:
 
         local plr = FindLocalPlayer();
 
         local plr = FindLocalPlayer();
 
         local v = plr.Pos;
 
         local v = plr.Pos;
         MessagePlayer( plr.Name + " esta en x=" + v.x + ", y=" + v.y + ", z=" + v.z , plr );
+
         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

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.

[edit] Syntax

You can either return or set a new value using this member:

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

  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.  

[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

  1.  
  2. -- todo
  3.  

[edit] Notes

-- List of used functions and other notes here.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox