Squirrel/Client/Functions/Players/Pos
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|Player.Pos}} {{ScriptingChangesIn0.1.0.11}} This ''Player'' class member returns or sets the position of the given player. Note that setting will only affect the…') |
IdkanYavuk (Talk | contribs) (→Example 1. Returning) |
||
(3 intermediate revisions by one user not shown) | |||
Line 14: | Line 14: | ||
== Example 1. Returning == | == Example 1. Returning == | ||
− | + | This command returns the player position | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | 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; | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
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