SA-MP Forums Archive
Best way to get three/four/five closest positions from an array? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Best way to get three/four/five closest positions from an array? (/showthread.php?tid=646652)



Best way to get three/four/five closest positions from an array? - Puppy - 21.12.2017

Working on a system that involves getting the three or so closest object positions from quite a large array, in comparison to a specific player. Keep in mind they not only have to be closest, but fit within a general range in categorization.

So: Any ideas on the most efficient way to accomplish this? I've thought of a few ways to do this, but I'm sure they're not the best methods. Thoughts?