getVehicleNodePosition
GET_VEHICLE_NODE_POSITION0x703123E5E7D429C2The GTA V native GET_VEHICLE_NODE_POSITION of the PATHFIND namespace, as LS:MP client scripts call it: the global function getVehicleNodePosition, in JavaScript and in Lua.
getVehicleNodePosition(nodeId: number): { x: number, y: number, z: number }getVehicleNodePosition(nodeId: integer): Vector3Usage
JavaScript
const { x, y, z } = getVehicleNodePosition(nodeId);Lua
local outPosition = getVehicleNodePosition(nodeId)
-- outPosition.x, outPosition.y, outPosition.zParameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
nodeId | int | number | integer |
Returns
The output: the value of the call in JavaScript, the return value in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | outPosition | Vector3 | { x: number, y: number, z: number } | Vector3 | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Calling this with an invalid node id, will crash the game.
Note that isVehicleNodeIdValid simply checks if nodeId is not zero. It does not actually ensure that the id is valid.
Eg. isVehicleNodeIdValid(1) will return true, but will crash when calling getVehicleNodePosition().
Reference
- Namespace
- Pathfinding PATHFIND
- In the game
void GET_VEHICLE_NODE_POSITION(int nodeId, Vector3* outPosition)- Hash
0x703123E5E7D429C2