2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-08 06:26:15 +00:00
|
|
|
/*
|
2015-08-10 06:45:43 +00:00
|
|
|
* Author: Dslyecxi, MikeMatrix
|
2015-08-08 06:26:15 +00:00
|
|
|
* Returns all players in a given range and in the units vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2020-06-19 15:35:57 +00:00
|
|
|
* 0: Positions (objects or posAGLs) <ARRAY>
|
2015-08-08 06:26:15 +00:00
|
|
|
* 1: Range <NUMBER>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2020-06-19 15:35:57 +00:00
|
|
|
* All units in proximity <ARRAY<OBJECT>>
|
2015-08-08 06:26:15 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2020-06-19 15:35:57 +00:00
|
|
|
* [[player], 7] call ace_map_gestures_fnc_getProximityPlayers
|
2015-08-08 06:26:15 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2020-06-19 15:35:57 +00:00
|
|
|
params ["_positions", "_range"];
|
2015-08-08 06:26:15 +00:00
|
|
|
|
2020-06-19 15:35:57 +00:00
|
|
|
private _proximityPlayers = [];
|
2016-10-27 17:54:58 +00:00
|
|
|
|
2020-06-19 15:35:57 +00:00
|
|
|
{
|
|
|
|
_proximityPlayers append (_x nearEntities [["CAMAnBase"], _range]);
|
|
|
|
if (_x isEqualType objNull) then {
|
|
|
|
_proximityPlayers append (crew vehicle _x);
|
|
|
|
};
|
|
|
|
} forEach _positions;
|
|
|
|
|
|
|
|
_proximityPlayers = _proximityPlayers arrayIntersect _proximityPlayers;
|
|
|
|
|
|
|
|
_proximityPlayers = _proximityPlayers select { [_x, false] call EFUNC(common,isPlayer); };
|
|
|
|
|
|
|
|
if (GVAR(onlyShowFriendlys)) then {
|
|
|
|
_proximityPlayers = _proximityPlayers select { [side group ace_player, side _x] call BIS_fnc_areFriendly; };
|
|
|
|
};
|
|
|
|
|
|
|
|
_proximityPlayers
|