getPedExtractedDisplacement
GET_PED_EXTRACTED_DISPLACEMENT0xE0AF41401ADF87E3The GTA V native GET_PED_EXTRACTED_DISPLACEMENT of the PED namespace, as LS:MP client scripts call it: the global function getPedExtractedDisplacement, in JavaScript and in Lua.
getPedExtractedDisplacement(
ped: Ped,
worldSpace: boolean
): { x: number, y: number, z: number }getPedExtractedDisplacement(ped: Ped, worldSpace: boolean): Vector3Usage
const { x, y, z } = getPedExtractedDisplacement(ped, worldSpace);local coords = getPedExtractedDisplacement(ped, worldSpace)
-- coords.x, coords.y, coords.zParameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
worldSpace | 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 offset the specified ped has moved since the previous tick.
If worldSpace is false, the returned offset is relative to the ped. That is, if the ped has moved 1 meter right and 5 meters forward, it'll return 1,5,0.
If worldSpace is true, the returned offset is relative to the world. That is, if the ped has moved 1 meter on the X axis and 5 meters on the Y axis, it'll return 1,5,0.
Reference
- Namespace
- Ped PED
- In the game
Vector3 GET_PED_EXTRACTED_DISPLACEMENT(Ped ped, BOOL worldSpace)- Hash
0xE0AF41401ADF87E3