Skip to content

A3D_GetRouteTurnCount

imshooter edited this page Oct 23, 2026 · 1 revision

Number of turns of a route.

native A3D_GetRouteTurnCount(Route:routeid);

Parameters

Parameter Description
Route:routeid Route to read.

Returns

  • The number of turns.
  • 0 when the route does not exist.

Remarks

Only the turns at junctions count, where a driver chooses a way. A road that bends between junctions makes no turn. A route of a few kilometres has about ten.

Example

stock PrintTurns(Route:routeid) {
    new
        Float:x,
        Float:y,
        Float:z,
        Float:distance,
        A3D_TURN:turn
    ;

    for (new index, count = A3D_GetRouteTurnCount(routeid); index != count; ++index) {
        turn = A3D_GetRouteTurn(routeid, index, x, y, z, distance);
        printf("after %.0f metres, turn %i", distance, _:turn);
    }
}

Related

  • A3D_GetRouteTurn: Read a turn of a route, at a junction where more than two ways meet.
  • 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