getPedBoneCoords
GET_PED_BONE_COORDS0x17C07FC640E86B4EThe GTA V native GET_PED_BONE_COORDS of the PED namespace, as LS:MP client scripts call it: the global function getPedBoneCoords, in JavaScript and in Lua.
getPedBoneCoords(
ped: Ped,
boneId: number,
offsetX: number,
offsetY: number,
offsetZ: number
): { x: number, y: number, z: number }getPedBoneCoords(
ped: Ped,
boneId: integer,
offsetX: number,
offsetY: number,
offsetZ: number
): Vector3Usage
JavaScript
const { x, y, z } = getPedBoneCoords(ped, boneId, offsetX, offsetY, offsetZ);Lua
local coords = getPedBoneCoords(ped, boneId, 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 = getPedBoneCoords(ped, boneId, offset);Lua · with vectors
local coords = getPedBoneCoords(ped, boneId, offset)Parameters
| Parameter | Type | JavaScript | Lua | Description |
|---|---|---|---|---|
ped | Ped | number | integer | The ped to get the position of a bone from. |
boneId | int | number | integer | The ID of the bone to get the position from. This is NOT the index. |
offsetX | float | number | number | The X-component of the offset to add to the position relative to the bone's rotation. |
offsetY | float | number | number | The Y-component of the offset to add to the position relative to the bone's rotation. |
offsetZ | float | number | number | The Z-component of the offset to add to the position relative to the bone's rotation. |
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 position of the specified bone of the specified ped.
Reference
- Namespace
- Ped PED
- In the game
Vector3 GET_PED_BONE_COORDS(Ped ped, int boneId, float offsetX, float offsetY, float offsetZ)- Hash
0x17C07FC640E86B4E