- Download and install the EditorConfig plugin for Visual Studio: https://github.com/editorconfig/editorconfig-visualstudio#readme
- Launch
premake.bat
- Open
Build/Pathfind.sln
- Put the resulting
Bin/ml_gps.dll/.so
into your MTA:SA servermodules
folder. - Add
<module src="ml_gps.dll"/>
(or.so
for Linux) to yourmtaserver.conf
. - Start the server
int loadPathGraph(string path)
- path: The path to the graph definition file (relative to the resource directory)
Returns graphId if everything went fine, false otherwise.
bool unloadPathGraph(int graphId)
- graphId: The id of the graph
Returns true if the graph has been unloaded, false otherwise.
bool findShortestPathBetween(int graphId, float startX, float startY, float startZ, float endX, float endY, float endZ, function callback)
- 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 true if the route calculation has been scheduled successfully, false otherwise.
bool isGraphLoaded(int graphId)
- graphId: The id of the graph
Returns true if the graph is already loaded, false otherwise.
int, float, float, float findNodeAt(int graphId, float positionX, float positionY, float positionZ)
- graphId: The id of the graph
- positionX, positionY, positionZ: The postion where to search for a node
Returns 4 integers representing nodeId and his position if a node was found, false otherwise.
table getNodeNeighbors(int graphId, int nodeId, int depth)
- graphId: The id of the graph
- nodeId: The id of the start node
- depth: The depth of the node neighbors
Returns a table with all neighbors of the node, false otherwise.
- Justus H.
- Stefan K.