CBA_fnc_getNearest

Description

Find out the nearest entity parsed in an array to a position.

Compares the distance between entity’s in the parsed array.

Parameters

_position<MARKER, OBJECT, LOCATION, GROUP, TASK or POSITION>
_arrayARRAY of <MARKER, OBJECT, LOCATION, GROUP, TASK and/or POSITION>
_radiusMaximum distance from _position <NUMBER>
_codeCondition to meet, object is stored in _x variable <CODE>

Example

_nearestVeh = [player, vehicles] call CBA_fnc_getNearest
_nearestGroups = [[0,0,0], allGroups, 50, {count (units _x) > 1}] call CBA_fnc_getNearest

Returns

Nearest given entity or List of entities within given distance

Author

Rommel

Array to read from [Array]
Close