GetPlayerObjectPos

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 20:35, 22 April 2014
MP2 (Talk | contribs)

← Previous diff
Current revision
OstGot (Talk | contribs)

Line 10: Line 10:
{{Param|Float:Z|A float variable in which to store the Z coordinate, passed by reference.}} {{Param|Float:Z|A float variable in which to store the Z coordinate, passed by reference.}}
-{{ReturnsSuccess||The player and/or the object don't exist.}}+{{ReturnsSuccess||The player and/or the object don't exist.
 +* The object's position is stored in the specified variables.}}
{{Example}} {{Example}}

Current revision



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

Personal tools
In other languages