[ArmA] findNearestWaypoint by Wolfrug
A function for determining the closest waypoint to any particular map spot.
Input 2d position (from onMapSingleClick or waypointPosition for instance).
Input name of trigger that covers wider area you want checked/is activated by side you want checked (or Anybody if you don't care).
(Optionally input minimum distance the waypoint has to be from the 2d position for it to return anything)
Output : waypoint (in waypoint format, i.e. [GroupName, WaypointNumber]) closest to position input.
View the forum thread for this resource here.