getNavmeshRouteDistanceRemaining
GET_NAVMESH_ROUTE_DISTANCE_REMAINING0xC6F5C0BCDC74D62DThe GTA V native GET_NAVMESH_ROUTE_DISTANCE_REMAINING of the TASK namespace, as LS:MP client scripts call it: the global function getNavmeshRouteDistanceRemaining, in JavaScript and in Lua.
getNavmeshRouteDistanceRemaining(ped: Ped): [
result: number,
distanceRemaining: number,
isPathReady: boolean
]getNavmeshRouteDistanceRemaining(ped: Ped): integer, number, booleanUsage
JavaScript
const [result, distanceRemaining, isPathReady] =
getNavmeshRouteDistanceRemaining(ped);Lua
local result, distanceRemaining, isPathReady =
getNavmeshRouteDistanceRemaining(ped)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
Returns
3 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | result | int | number | integer | The native’s own return value. |
| 2 | distanceRemaining | float | number | number | output |
| 3 | isPathReady | BOOL | boolean | boolean | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Looks like the last parameter returns true if the path has been calculated, while the first returns the remaining distance to the end of the path.
Return value of native is the same as getNavmeshRouteResult
Looks like the native returns an int for the path's state:
1 - ???
2 - ???
3 - Finished Generating
Reference
- Namespace
- Tasks TASK
- In the game
int GET_NAVMESH_ROUTE_DISTANCE_REMAINING(Ped ped, float* distanceRemaining, BOOL* isPathReady)- Hash
0xC6F5C0BCDC74D62D