RedM Natives

GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS

Offset values are relative to the entity.

Hash0x1899F328B0E12848
Runtime nameGetOffsetFromEntityInWorldCoords
NamespaceENTITY
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x1899F328B0E12848

Signature

Vector3 GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(Entity entity, float offsetX, float offsetY, float offsetZ);

Parameters

NameTypeDescription
entityEntity—
offsetXfloat—
offsetYfloat—
offsetZfloat—

Returns Vector3

Description

Offset values are relative to the entity.

x = left/right
y = forward/backward
z = up/down

Usage

Lua
local retval = GetOffsetFromEntityInWorldCoords(entity, offsetX, offsetY, offsetZ)

-- always works, by hash
local retval = Citizen.InvokeNative(0x1899F328B0E12848, entity, offsetX, offsetY, offsetZ, Citizen.ResultAsVector())
JavaScript and C#
JavaScript
const retval = GetOffsetFromEntityInWorldCoords(entity, offsetX, offsetY, offsetZ);

// by hash
const retval = Citizen.invokeNative('0x1899F328B0E12848', entity, offsetX + 0.0000001, offsetY + 0.0000001, offsetZ + 0.0000001, Citizen.returnResultAnyway(), Citizen.resultAsVector());
C#
Vector3 retval = Function.Call<Vector3>((Hash)0x1899F328B0E12848, entity, offsetX, offsetY, offsetZ);
  • Float parameters: Lua integers (10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write 10.0 or value + 0.0. The generated JS wrappers add 0.0000001 to non-zero floats for the same reason.

Sources

alloc8or RDR3 NativeDB

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