Squirrel/Server/Functions/Players/Pos
From Liberty Unleashed Wiki
(Difference between revisions)
Line 10: | Line 10: | ||
== Arguments == | == Arguments == | ||
− | * '''vPos''' - This is the new position for the player as a | + | * '''vPos''' - This is the new position for the player as a [[Squirrel/Script_Types/Vector|Vector]] |
== Example 1. Returning == | == Example 1. Returning == |
Latest revision as of 11:24, 12 October 2010
This Player class member returns or sets the position of the given player.
[edit] Syntax
You can either return or set a new value using this member:
Vector player.Pos
player.Pos = Vector vPos
[edit] Arguments
- vPos - This is the new position for the player as a Vector
[edit] Example 1. Returning
function onPlayerCommand( player, cmd, text ) { if ( cmd == "mypos" ) { MessagePlayer( "Your current position is: " + player.Pos, player ); } }
This command will tell the player their current co-ordinates.
[edit] Example 2. Setting
function onPlayerCommand( player, cmd, text ) { if ( cmd == "setmypos" ) { local newpos = Vector( 100.00, 90.00, 1.00 ); player.Pos = newpos; } }
This command will set the players position to the co-ordinates of 100.00 (X), 90.00 (Y), 1.00 (Z).
[edit] Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
[edit] Related Functions
- FindPlayer
- GetClosestPlayer
- Player.Alpha
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.ClearWeapons
- Player.Colour
- Player.ColouredName
- Player.EnterVehicle
- Player.ExitVehicle
- Player.ForceToSpawnScreen
- Player.Frozen
- Player.GetBoundariesLower
- Player.GetBoundariesUpper
- Player.GetIgnored
- Player.Health
- Player.ID
- Player.IP
- Player.Immune
- Player.Island
- Player.LUID
- Player.Marker
- Player.MarkerScale
- Player.MarkerSprite
- Player.Muted
- Player.Name
- Player.Nametag
- Player.NametagColour
- Player.Ping
- Player.Pos
- Player.RemoveFromVehicle
- Player.RemoveLimb
- Player.Score
- Player.SetAnim
- Player.SetBoundaries
- Player.SetIgnored
- Player.SetIgnoredBy
- Player.SetVehicleEnterDoor
- Player.SetWeapon
- Player.Skin
- Player.Spawn
- Player.Spawned
- Player.Team
- Player.Train
- Player.Vehicle
- Player.VehicleSeat
- Player.Velocity
- Player.VirtualWorld
- Player.WantedLevel
- Player.Weapon
- Player.SetWeapon
- Player.WeaponAmmo
- Player.WeaponState