The Lab
ENTITY native

GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS

returns Vector34 paramsbuild 1207

Converts world coordinates into an offset relative to the entity.

Signature

C
Vector3 GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS(Entity entity, float posX, float posY, float posZ); // 0x497C6B1A2C9AE69C b1207

Parameters

#NameType
1entityEntity
2posXfloat
3posYfloat
4posZfloat

Facts

Facts about GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
Name
GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
Hash
0x497C6B1A2C9AE69C
Namespace
Returns
Vector3
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local coords = Citizen.InvokeNative(0x497C6B1A2C9AE69C, -- GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
  PlayerPedId(), -- Entity entity
  0.0, -- float posX
  0.0, -- float posY
  0.0, -- float posZ
  Citizen.ResultAsVector()
)
print(coords.x, coords.y, coords.z)
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const coords = Citizen.invokeNative("0x497C6B1A2C9AE69C", // GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
  PlayerPedId(), // Entity entity
  0.0, // float posX
  0.0, // float posY
  0.0, // float posZ
  Citizen.resultAsVector()
);
const [x, y, z] = coords
C#
Vector3 coords = Function.Call<Vector3>((Hash)0x497C6B1A2C9AE69C, // GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS
  API.PlayerPedId(), // Entity entity
  0.0f, // float posX
  0.0f, // float posY
  0.0f // float posZ
);
All ENTITY natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.