Modules/Pathfinding/findShortestPathBetween

From Multi Theft Auto: Wiki
Jump to navigation Jump to search


Package-x-generic.png This function is provided by the external module Pathfinding. You must install this module to use this function.

This function finds the shortest path between 2 points in the world.

Syntax

bool findShortestPathBetween(int graphId, float startX, float startY, float startZ, float endX, float endY, float endZ, function callback)

Required arguments

  • graphId: The id of the graph
  • startX, startY, startZ: The start position
  • endX, endY, endZ: The end position
  • callback: The callback function (parameters: table nodes)

Returns

Returns true if the route calculation has been scheduled successfully, false otherwise.

Example

Issues

Issue ID Description
8 Providing callback function to findShortestPathBetween crashes the server

See Also

Functions