forked from IDI-Systems/acre2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfnc_getPlayerRadioList.sqf
50 lines (40 loc) · 1.75 KB
/
fnc_getPlayerRadioList.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "script_component.hpp"
/*
* Author: ACRE2Team
* Retrieves a list of unique radio IDs that can be accessed by a player. This includes radios in the inventory that are not being
* used externally and those radios that are used externally.
*
* Arguments:
* None
*
* Return Value:
* Array of unique radio IDs <ARRAY>
*
* Example:
* [] call acre_sys_data_fnc_getPlayerRadioList
*
* Public: No
*/
private _radioList = [];
if (!ACRE_IS_SPECTATOR) then {
private _weapons = [acre_player] call EFUNC(sys_core,getGear);
_radioList = _weapons select {_x call EFUNC(sys_radio,isUniqueRadio) && {!(_x call EFUNC(sys_external,isExternalRadioUsed))}};
// External radios not in the inventory of the player
_radioList append ACRE_ACTIVE_EXTERNAL_RADIOS;
// Radios in the inventory of the player that are being used externally but cannot be used by the player (receive/transmit). They can still be configured, e.g. manpack radios
_radioList append ACRE_EXTERNALLY_USED_PERSONAL_RADIOS;
// Radios in the inventory of the player that are being used externally but can still be used by the player, e.g. manpack radios
_radioList append ACRE_EXTERNALLY_USED_MANPACK_RADIOS;
// Auxilary radios are for radios not in inventory like racked radios
_radioList append ACRE_ACCESSIBLE_RACK_RADIOS;
// Racked radios that cannot be physically accessed but are connected to the same intercom as the player
_radioList append ACRE_HEARABLE_RACK_RADIOS;
// If Arsenal is open radios are stashed in var until left
_radioList append ACRE_ARSENAL_RADIOS;
if (ACRE_ACTIVE_RADIO != "") then {
_radioList append [ACRE_ACTIVE_RADIO];
};
} else {
_radioList = ACRE_SPECTATOR_RADIOS;
};
_radioList arrayIntersect _radioList