ACE3/addons/spectator/XEH_postInit.sqf
2015-07-21 22:56:47 +01:00

20 lines
790 B
Plaintext

#include "script_component.hpp"
//#include "initKeybinds.sqf";
// Add interaction menu exception
["isNotSpectating", {!((_this select 0) getVariable [QGVAR(isSpectator), false])}] call EFUNC(common,addCanInteractWithCondition);
// Run spectator framework if enabled
["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);
if !(hasInterface) exitWith {};
if (GVAR(system)) then {
// Add event handlers to correctly enter spectator upon death
player addEventHandler ["Killed", FUNC(handleKilled)];
player addEventHandler ["Respawn", FUNC(handleRespawn)];
};
}] call EFUNC(common,addEventHandler);