GetPlayerPos: Difference between revisions

From NPC for VCMP 0.4 Servers
Jump to navigation Jump to search
(Created page with "{{Welcome|desc=Gets the position of a player as Vector.|params=<syntaxhighlight lang="lua">playerid</syntaxhighlight> <poem>::playerid : The ID of the player whose position is...")
 
No edit summary
 
Line 13: Line 13:
relfuncs=*[[GetPlayerFacingAngle]]
relfuncs=*[[GetPlayerFacingAngle]]
*[[IsPlayerStreamedIn]]
*[[IsPlayerStreamedIn]]
}}

Latest revision as of 14:22, 22 March 2022


Description:
Gets the position of a player as Vector.


Parameters:

playerid

playerid : The ID of the player whose position is needed.


Return Values:
The position of the player as Vector


Example

if( IsPlayerStreamedIn(playerid))
{
     local pos=GetPlayerPos(playerid);
     local msg=format( " Player %d is at %f x units, %f y units and %f z units", playerid, pos.x, pos.y, pos.z);
}
else 
     print( "Player " + playerid + " is not streamed in" );

Related Functions

The following functions may be helpful as they relate to this function in one way or another.