SA-MP Forums Archive
Getting the nearest point. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Getting the nearest point. (/showthread.php?tid=228628)



Getting the nearest point. - Haydz - 20.02.2011

Hey guys, how would i go about getting the nearest point between loading points, and it selects the nearest point for the loading point.

For example
pawn Код:
{"Verdant Meadows",         365.0988,2537.2412,16.6660      },
    {"San Fierro Carrier",      -1297.5808,495.5921,18.2344     },
    {"Los Santos Carrier",      444.4464,-3071.7390,16.0448     },
    {"Los Santos Carrier",      533.2236,-3070.7485,16.0497     },
    {"Ocean Flats Airbase",     -2905.1726,443.1617,4.9141      },
    {"Las Venturas Carrier",    2668.6533,539.7664,17.6141      },
    {"Las Venturas Carrier",    2585.4248,540.7264,17.6141      },
    {"Area 51",                 308.5738,2053.2815,17.6406      }
};
//how could i make it select the nearest airport to them. cheers and thanks in advance.



Re: Getting the nearest point. - Haydz - 20.02.2011

Cheers, do you think you could give me an example on how i would go about doing it?