Skip to content

A3D_GetRouteLength

imshooter edited this page Oct 23, 2026 · 1 revision

Length of a route, in metres.

native Float:A3D_GetRouteLength(Route:routeid);

Parameters

Parameter Description
Route:routeid Route to measure.

Returns

  • The length.
  • 0.0 when the route does not exist.

Remarks

The length runs along the paths, from where the start meets them to where the end meets them, with the walks on the navigation mesh at both ends when there are some. It is measured in three dimensions, so a climb counts.

Example

Prices a taxi ride by the length of the road.

stock TaxiFare(Route:routeid) {
    return 50 + floatround(A3D_GetRouteLength(routeid) / 100.0) * 5;
}

Related

  • A3D_GetRouteTime: Time a route takes, in seconds.
  • A3D_MeasureRoute: Measure the best route between two points without keeping it, which is faster than finding it.
  • A3D_GetRouteProgress: Find where a point is along a route: the distance left, the distance from the route and the next turn.

Home

Guides

Reference

Functions

Creating objects
Motion
Placement
Behaviour
Display and data
Rays
Shapes
Players, vehicles and actors
Map probes
Screen
Map objects
Water
Models and surfaces
Rotations and offsets
Vehicles
Routes
Route display
Walking
Callbacks

Clone this wiki locally