Repository navigation
A3D_MeasureRoute
imshooter edited this page Oct 23, 2026
·
1 revision
Measure the best route between two points without keeping it, which is faster than finding it.
native bool:A3D_MeasureRoute(
Float:fromX,
Float:fromY,
Float:fromZ,
Float:toX,
Float:toY,
Float:toZ,
&Float:length,
&Float:time,
A3D_ROUTE:type = A3D_ROUTE_FASTEST,
Float:heading = -1.0,
Float:reach = 300.0
);| Parameter | Description | Default |
|---|---|---|
Float:fromX |
Start on the X axis. | |
Float:fromY |
Start on the Y axis. | |
Float:fromZ |
Start on the Z axis. | |
Float:toX |
End on the X axis. | |
Float:toY |
End on the Y axis. | |
Float:toZ |
End on the Z axis. | |
&Float:length |
Length of the route, in metres. | |
&Float:time |
Time the route takes, in seconds. | |
A3D_ROUTE:type |
How the route weighs the paths. | A3D_ROUTE_FASTEST |
Float:heading |
Direction the vehicle faces at the start, or -1.0 for none. |
-1.0 |
Float:reach |
How far from each end to look for a path, in metres. | 300.0 |
-
truewhen a route was found. -
falsewhen no path is within reach, or the ends are not connected.
It finds the route as A3D_FindRoute does, but keeps no points, which makes it about three times faster. It suits prices, rankings and checks that need only a number.
Tells the price and the time of a taxi ride before it starts.
stock QuoteFare(playerid, Float:x, Float:y, Float:z) {
new
Float:fromX,
Float:fromY,
Float:fromZ,
Float:length,
Float:time,
message[80]
;
GetPlayerPos(playerid, fromX, fromY, fromZ);
if (!A3D_MeasureRoute(fromX, fromY, fromZ, x, y, z, length, time)) {
SendClientMessage(playerid, -1, "No road leads there.");
return;
}
format(message, sizeof (message), "The ride costs $%i and takes about %i minutes.", 50 + floatround(length / 20.0), floatround(time / 60.0, floatround_ceil));
SendClientMessage(playerid, -1, message);
}- A3D_FindRoute: Find the best route between two points along the paths of the game.
- A3D_FindNearestByRoute: Find which of several points the best route from a point reaches first, such as the nearest hospital by road rather than in a straight line.
- A3D_GetRouteLength: Length of a route, in metres.
3DAndreas 0.7.0 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions