getEntityCoords
GET_ENTITY_COORDS0x3FEF770D40960D5AThe GTA V native GET_ENTITY_COORDS of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityCoords, in JavaScript and in Lua.
getEntityCoords(
entity: Entity,
alive: boolean
): { x: number, y: number, z: number }getEntityCoords(entity: Entity, alive: boolean): Vector3Usage
JavaScript
const { x, y, z } = getEntityCoords(entity, alive);Lua
local coords = getEntityCoords(entity, alive)
-- coords.x, coords.y, coords.zParameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
entity | Entity | number | integer |
alive | BOOL | boolean | boolean |
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.
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 of GTA in order to assert whether or not an entity was alive.
Reference
- Namespace
- Entity ENTITY
- In the game
Vector3 GET_ENTITY_COORDS(Entity entity, BOOL alive)- Hash
0x3FEF770D40960D5A