ACE3/addons/spectator/XEH_postInit.sqf
SilentSpike dbcf94153d Merge pull request #3155 from acemod/spectatorFix
Fix some spectator errors
2016-01-15 15:43:45 +00:00

20 lines
826 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 EFUNC(common,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
addMissionEventHandler ["Ended",{ [QGVAR(EndMission)] call FUNC(interrupt) }];