PhysicsClient

getCgoffset

GET_CGOFFSET0x8214A4B5A7A33612

The GTA V native GET_CGOFFSET of the PHYSICS namespace, as LS:MP client scripts call it: the global function getCgoffset, in JavaScript and in Lua.

SignatureJavaScript
getCgoffset(entity: Entity): { x: number, y: number, z: number }
SignatureLua
getCgoffset(entity: Entity): Vector3

Usage

JavaScript
const { x, y, z } = getCgoffset(entity);
Lua
local coords = getCgoffset(entity)
-- coords.x, coords.y, coords.z

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 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.

Reference

Namespace
Physics PHYSICS
In the game
Vector3 GET_CGOFFSET(Entity entity)
Hash
0x8214A4B5A7A33612

Open in the interactive natives reference