11.10.2011, 15:58
(
Последний раз редактировалось Kyle; 04.02.2015 в 15:52.
)
N/A.
whyui donr;'t uyoui usew somenione nodews rewader tot reasd noes??
MAns sryyyyyu I'm a bit druhnk I hope Ijehleped u................. https://sampforum.blast.hk/showthread.php?tid=269695 FREWASAAHHHH TYEAHHH!!!!!!! NOOO NEEEEDPL TO PswaAAAAY |
Nodes can either be created yourself or extracted from nodes.dat. However, there are around 27,000+ nodes in nodes.dat which make all the single player traffic work. You then need to select an algorithm to use to find the shortest distance form Point A to Point B. The most popular algorithm being used to do this is 'Dijkstra Algorithim' or a modification of it. It can find the shortest distance from Point A to Point B by working out the lowest 'cost' to all nodes adjacent to a given node. It does this for all nodes, which is why using nodes from nodes.dat can take very long.
So, to make a GPS, you need to first research the dijkstra's algorithm and understand how it actually works. Then you can look up some pseudo code for it and apply it to pawn, you'll probably have to modify it to make it work though. Then you need to either drive around SA, and save the co-ordinates of all the intersections. These will be your nodes. You also need to figure out a way to find out the 'neighbours' of a particular node. Then you put it all together, use Race checkpoints, and create a command that searches for the nearest node to the players location, and figure out the shortest path from that node to the node nearest to the finishing location. I do not believe in scripting for money, which is why I have taken time to tell you how you can create such a GPS system. TL DR: How to make the GPS system. |