Squirrel/Script Types/Vector
From Liberty Unleashed Wiki
The Vector type is a 3-dimensional vector used to set/return positions and rotations for elements such as players, vehicles, objects etc.
Constructor
Vector( float x, float y, float z )
Values
- x - The X coordinate of the vector
- y - The Y coordinate of the vector
- z - The Z coordinate of the vector
Example
This will return and show player's position when they type '/pos'
function onPlayerCommand( player, cmd, text ) { if ( cmd == "pos" ) { local pos = player.Pos; // Save the position vector to a local variable MessagePlayer( "Your position: " + pos.x + ", " + pos.y + ", " + pos.z , player ); } }