GetPlayerObjectPos

From SA-MP Wiki

Jump to: navigation, search


Description:

Get the position of a player object (CreatePlayerObject).


Parameters:
(playerid, objectid, &Float:X, &Float:Y, &Float:Z)
playeridThe ID of the player whose player object to get the position of.
objectidThe object's id of which you want the current location.
&Float:XA float variable in which to store the X coordinate, passed by reference.
&Float:YA float variable in which to store the Y coordinate, passed by reference.
&Float:ZA float variable in which to store the Z coordinate, passed by reference.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute. The player and/or the object don't exist.
  • The object's position is stored in the specified variables.


Example Usage:

new Float:x, Float:y, Float:z;
GetPlayerObjectPos(playerid, objectid, x, y, z);

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

Player Objects


Global Objects

In other languages