getOffsetFromEntityInWorldCoords
GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS0x1899F328B0E12848The GTA V native GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS of the ENTITY namespace, as LS:MP client scripts call it: the global function getOffsetFromEntityInWorldCoords, in JavaScript and in Lua.
getOffsetFromEntityInWorldCoords(
entity: Entity,
offsetX: number,
offsetY: number,
offsetZ: number
): { x: number, y: number, z: number }getOffsetFromEntityInWorldCoords(
entity: Entity,
offsetX: number,
offsetY: number,
offsetZ: number
): Vector3Usage
JavaScript
const { x, y, z } = getOffsetFromEntityInWorldCoords(entity, offsetX, offsetY, offsetZ);Lua
local coords = getOffsetFromEntityInWorldCoords(entity, offsetX, offsetY, offsetZ)
-- coords.x, coords.y, coords.zThree consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
JavaScript · with vectors
const coords = getOffsetFromEntityInWorldCoords(entity, offset);Lua · with vectors
local coords = getOffsetFromEntityInWorldCoords(entity, offset)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
offsetX | float | number | number |
offsetY | float | number | number |
offsetZ | float | number | number |
Returns
Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Offset values are relative to the entity.
x = left/right
y = forward/backward
z = up/down
Reference
- Namespace
- Entity ENTITY
- In the game
Vector3 GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(Entity entity, float offsetX, float offsetY, float offsetZ)- Hash
0x1899F328B0E12848