isPointOnRoad
IS_POINT_ON_ROAD0x125BF4ABFC536B09The GTA V native IS_POINT_ON_ROAD of the PATHFIND namespace, as LS:MP client scripts call it: the global function isPointOnRoad, in JavaScript and in Lua.
isPointOnRoad(x: number, y: number, z: number, vehicle: Vehicle): booleanisPointOnRoad(x: number, y: number, z: number, vehicle: Vehicle): booleanUsage
JavaScript
const result = isPointOnRoad(x, y, z, vehicle);Lua
local result = isPointOnRoad(x, y, z, vehicle)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 result = isPointOnRoad(pos, vehicle);Lua · with vectors
local result = isPointOnRoad(pos, vehicle)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
x | float | number | number |
y | float | number | number |
z | float | number | number |
vehicle | Vehicle | number | integer |
Returns
BOOL JavaScript boolean, Lua booleanNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Gets a value indicating whether the specified position is on a road.
The vehicle parameter is not implemented (ignored).
Reference
- Namespace
- Pathfinding PATHFIND
- In the game
BOOL IS_POINT_ON_ROAD(float x, float y, float z, Vehicle vehicle)- Hash
0x125BF4ABFC536B09