PathfindingClient1 output

getVehicleNodePosition

GET_VEHICLE_NODE_POSITION0x703123E5E7D429C2

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

SignatureJavaScript
getVehicleNodePosition(nodeId: number): { x: number, y: number, z: number }
SignatureLua
getVehicleNodePosition(nodeId: integer): Vector3

Usage

JavaScript
const { x, y, z } = getVehicleNodePosition(nodeId);
Lua
local outPosition = getVehicleNodePosition(nodeId)
-- outPosition.x, outPosition.y, outPosition.z

Parameters

ParameterTypeJavaScriptLua
nodeIdintnumberinteger

Returns

The output: the value of the call in JavaScript, the return value in Lua.

#ValueTypeJavaScriptLuaDescription
1outPositionVector3{ x: number, y: number, z: number }Vector3output

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

Open in the interactive natives reference