Skip to main content

GetObjectPos

Description

Get the position of an object.

NameDescription
objectidThe ID of the object to get the position of..
&Float:xA variable in which to store the X coordinate, passed by reference.
&Float:yA variable in which to store the Y coordinate, passed by reference.
&Float:zA variable in which to store the Z coordinate, passed by reference.

Returns

true - The function executed successfully.

false - The function failed to execute. The specified object does not exist.

Examples

public OnGameModeInit()
{
new objectid = CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);

new Float:x, Float:y, Float:z;
GetObjectPos(objectid, x, y, z);
// x = 2001.195679
// y = 1547.113892
// z = 14.283400
return 1;
}