RedM Natives

GET_ENTITY_COORDS

Gets the current coordinates for a specified entity.

Hash0xA86D5F069399F44D
Runtime nameGetEntityCoords
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x3FEF770D40960D5A

Signature

Vector3 GET_ENTITY_COORDS(Entity entity, BOOL alive, BOOL realCoords);

Parameters

NameTypeDescription
entityEntity—
aliveBOOL—
realCoordsBOOL—

Returns Vector3

Description

Gets the current coordinates for a specified entity.
entity = The entity to get the coordinates from.
alive = Unused by the game, potentially used by debug builds in order to assert whether or not an entity was alive.

If entity is a ped and it's in a vehicle or on a mount the coords of that entity are returned. Set 'realCoords' to true when you need the true ped coords.

Usage

Lua
local retval = GetEntityCoords(entity, alive, realCoords)

-- always works, by hash
local retval = Citizen.InvokeNative(0xA86D5F069399F44D, entity, alive, realCoords, Citizen.ResultAsVector())
JavaScript and C#
JavaScript
const retval = GetEntityCoords(entity, alive, realCoords);

// by hash
const retval = Citizen.invokeNative('0xA86D5F069399F44D', entity, alive, realCoords, Citizen.returnResultAnyway(), Citizen.resultAsVector());
C#
Vector3 retval = Function.Call<Vector3>((Hash)0xA86D5F069399F44D, entity, alive, realCoords);

See also

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.