TasksClient2 outputs

getNavmeshRouteDistanceRemaining

GET_NAVMESH_ROUTE_DISTANCE_REMAINING0xC6F5C0BCDC74D62D

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

SignatureJavaScript
getNavmeshRouteDistanceRemaining(ped: Ped): [
  result: number,
  distanceRemaining: number,
  isPathReady: boolean
]
SignatureLua
getNavmeshRouteDistanceRemaining(ped: Ped): integer, number, boolean

Usage

JavaScript
const [result, distanceRemaining, isPathReady] =
  getNavmeshRouteDistanceRemaining(ped);
Lua
local result, distanceRemaining, isPathReady =
    getNavmeshRouteDistanceRemaining(ped)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger

Returns

3 values, in this order: an array in JavaScript, multiple return values in Lua.

#ValueTypeJavaScriptLuaDescription
1resultintnumberintegerThe native’s own return value.
2distanceRemainingfloatnumbernumberoutput
3isPathReadyBOOLbooleanbooleanoutput

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

Open in the interactive natives reference