Functions: Bases: findNearestBase
AW_fnc_findNearestBase is used to, believe it or not, find the nearest base to a given
object. Any base can be found as well as, specifically, OPFOR- or BLUFOR-controlled bases.
- 0: Position (
object) - The position to find the nearest base to. If an
objectis provided, the position of the
- 1: Blacklist (
array) - An array of bases that should be ignored when finding a base.
- 2: Side (
side) - The side who should own the found base. Defaults to finding all bases regardless of side.
- Base Code (
string) - The original marker for the base.
Finding the nearest base to the player.
_base = [player] call AW_fnc_findNearestBase;
Find the second-nearest base to the player.
_nearest = [player] call AW_fnc_findNearestBase; _secondNearest = [player, [_nearest]] call AW_fnc_findNearestBase;
Find the nearest OPFOR base to the position
_base = [[514,221,0.2], , EAST] call AW_fnc_findNearestBase;