/* * Author: SilentSpike * Sets target unit to the given spectator state (virtually) * To physically handle a spectator see ace_spectator_fnc_stageSpectator * * Units will be able to communicate in ACRE/TFAR as appropriate * The spectator interface will be opened/closed * * Arguments: * 0: Unit to put into spectator state * 1: Spectator state * * Return Value: * None * * Example: * [player, true] call ace_spectator_fnc_setSpectator * * Public: Yes */ #include "script_component.hpp" params ["_unit", ["_set",true,[true]]]; // Only run for player units if !(isPlayer _unit) exitWith {}; if !(local _unit) exitwith { [[_unit, _set, _target], QFUNC(setSpectator), _unit] call EFUNC(common,execRemoteFnc); }; if (_set) then { ["open"] call FUNC(handleInterface); } else { ["close"] call FUNC(handleInterface); }; // Handle common addon audio if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {EGVAR(hearing,disableVolumeUpdate) = _set}; if (["acre_sys_radio"] call EFUNC(common,isModLoaded)) then {[_set] call acre_api_fnc_setSpectator}; if (["task_force_radio"] call EFUNC(common,isModLoaded)) then {[_unit, _set] call TFAR_fnc_forceSpectator}; ["spectatorSet",[_set]] call EFUNC(common,localEvent);