getRandomVehicleNode
GET_RANDOM_VEHICLE_NODE0x93E0DB8440B73A7DThe GTA V native GET_RANDOM_VEHICLE_NODE of the PATHFIND namespace, as LS:MP client scripts call it: the global function getRandomVehicleNode, in JavaScript and in Lua.
getRandomVehicleNode(
x: number,
y: number,
z: number,
radius: number,
p4: boolean,
p5: boolean,
p6: boolean
): [
ok: boolean,
outPosition: { x: number, y: number, z: number },
nodeId: number
]getRandomVehicleNode(
x: number,
y: number,
z: number,
radius: number,
p4: boolean,
p5: boolean,
p6: boolean
): boolean, Vector3, integerUsage
JavaScript
const [ok, outPosition, nodeId] = getRandomVehicleNode(x, y, z, radius, p4, p5, p6);Lua
local ok, outPosition, nodeId = getRandomVehicleNode(x, y, z, radius, p4, p5, p6)Three 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 [ok, outPosition, nodeId] = getRandomVehicleNode(pos, radius, p4, p5, p6);Lua · with vectors
local ok, outPosition, nodeId = getRandomVehicleNode(pos, radius, p4, p5, p6)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
x | float | number | number |
y | float | number | number |
z | float | number | number |
radius | float | number | number |
p4 | BOOL | boolean | boolean |
p5 | BOOL | boolean | boolean |
p6 | BOOL | boolean | boolean |
Returns
3 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | outPosition | Vector3 | { x: number, y: number, z: number } | Vector3 | output |
| 3 | nodeId | int | number | integer | output |
Reference
- Namespace
- Pathfinding PATHFIND
- In the game
BOOL GET_RANDOM_VEHICLE_NODE(float x, float y, float z, float radius, BOOL p4, BOOL p5, BOOL p6, Vector3* outPosition, int* nodeId)- Hash
0x93E0DB8440B73A7D