mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
00fa94e636
* Initial Rewrite * improve getProximityPlayers * add Zeus Implementation * fix missing simicolon * add Spectator Support * improve local responsiveness * add Vanilla Spectator Support * Fix Both Spectators are now working correctly * exit mouse moving event early when disabled * Move Diary Event registration to XEH DisplayLoaded Port Settings to SQF Add Setting for only showing Friendly Units pointing * Fix Merge Issue in Stringtable Redo Settings * fix a copy past script error * Update addons/map_gestures/functions/fnc_getProximityPlayers.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Lazy evals and defines * Small changes * Simplify initDisplayDiary and fix loading saves * Cache getProximityPlayers Improve Vanilla Spectator Support and how Followed unit Nearby data * Minor header update Co-authored-by: PabstMirror <pabstmirror@gmail.com>
39 lines
976 B
Plaintext
39 lines
976 B
Plaintext
#include "script_component.hpp"
|
|
/*
|
|
* Author: Dslyecxi, MikeMatrix
|
|
* Returns all players in a given range and in the units vehicle.
|
|
*
|
|
* Arguments:
|
|
* 0: Positions (objects or posAGLs) <ARRAY>
|
|
* 1: Range <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* All units in proximity <ARRAY<OBJECT>>
|
|
*
|
|
* Example:
|
|
* [[player], 7] call ace_map_gestures_fnc_getProximityPlayers
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_positions", "_range"];
|
|
|
|
private _proximityPlayers = [];
|
|
|
|
{
|
|
_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
|