Repository navigation
A3D_OnRouteLeft
A player strayed from the route shown to them.
A player strays when they are 30 metres farther from the route than the nearest they have been to it, so a route shown to a player who is away from it, as in a car park beside the road, waits until they move off. It is not called again until they come back within 15 metres of that distance.
public A3D_OnRouteLeft(playerid, Route:routeid, Float:distance)| Parameter | Description |
|---|---|
playerid |
Player who strayed. |
Route:routeid |
Route they left. |
Float:distance |
Distance from the player to the route. |
The component checks five times a second. The callback comes once when the player is 30 metres farther from the route than the nearest they have been to it, and not again until they come back within 15 metres of that distance. So a route shown to a player who is away from it, as in a car park beside the road, waits until they move off instead of calling it at once. A new route from where the player is, as a GPS finds, brings them back. It is called in the script that found the route.
Finds the way again from where the player strayed.
static Float:gDestination[MAX_PLAYERS][3];
public A3D_OnRouteLeft(playerid, Route:routeid, Float:distance) {
new
Float:x,
Float:y,
Float:z,
Route:found
;
GetPlayerPos(playerid, x, y, z);
found = A3D_FindRoute(x, y, z, gDestination[playerid][0], gDestination[playerid][1], gDestination[playerid][2]);
if (found == INVALID_ROUTE_ID) {
return 1;
}
A3D_ShowRouteForPlayer(playerid, found);
A3D_DestroyRoute(routeid);
return 1;
}- A3D_ShowRouteForPlayer: Show a route on the radar and the map of a player as a line, which moves on as they go.
- A3D_OnRouteArrived: A player reached the end of the route shown to them. The route stays on the map until it is hidden or destroyed.
- A3D_FindRoute: Find the best route between two points along the paths of the game.
3DAndreas 0.7.1 · 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