mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
108ff4f644
Regex used: \[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\) [$1,$3,$2] call CBA_fnc_targetEvent E?FUNC\((common,)?(server|global|local)Event\) CBA_fnc_$2Event E?FUNC\((common,)?(add|remove)EventHandler\) CBA_fnc_$2EventHandler
30 lines
1002 B
Plaintext
30 lines
1002 B
Plaintext
#include "script_component.hpp"
|
|
//#include "initKeybinds.sqf";
|
|
|
|
// Add interaction menu exception
|
|
["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition);
|
|
|
|
["SettingsInitialized", {
|
|
GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes);
|
|
GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions);
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
// Create a radio channel for any spectators to text chat in
|
|
if (isServer) then {
|
|
GVAR(channel) = radioChannelCreate [[0.729,0.149,0.098,1],"Spectator","Spectator (%UNIT_NAME)",[]];
|
|
publicVariable QGVAR(channel);
|
|
};
|
|
|
|
// Should prevent unending spectator on mission end
|
|
if (isServer) then {
|
|
addMissionEventHandler ["Ended", {
|
|
[QGVAR(endMission), []] call CBA_fnc_globalEvent;
|
|
}];
|
|
};
|
|
|
|
[QGVAR(endMission), {
|
|
if (GVAR(isSet)) then {
|
|
[false] call FUNC(setSpectator);
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|