ACE3/addons/vehiclelock/XEH_postInit.sqf
commy2 001942b2ed Vehicle Lock - Enable for planes (#6646)
* enable vehicle lock module for planes

* Add actions to planes

* improved lazy eval

* remove superfluous parent class check

* IS_KIND_OF_ANY macro

* Update addons/vehiclelock/functions/fnc_moduleSync.sqf

* Improve handleVehicleInitPost XEH
2018-10-21 16:37:16 -05:00

22 lines
971 B
Plaintext

#include "script_component.hpp"
//Add Event Handlers
[QGVAR(setupCustomKey), {_this call FUNC(serverSetupCustomKeyEH)}] call CBA_fnc_addEventHandler;
[QGVAR(setVehicleLock), {_this call FUNC(setVehicleLockEH)}] call CBA_fnc_addEventHandler;
["ace_settingsInitialized", {
TRACE_2("SettingsInitialized eh",GVAR(LockVehicleInventory),GVAR(VehicleStartingLockState));
if (hasInterface && {GVAR(LockVehicleInventory)}) then {
["CAManBase", "InventoryOpened", {_this call FUNC(onOpenInventory)}] call CBA_fnc_addClassEventHandler;
};
if (isServer && {GVAR(VehicleStartingLockState) != -1}) then {
[{
TRACE_1("adding lock handler",GVAR(VehicleStartingLockState));
{
[_x, "initpost", LINKFUNC(handleVehicleInitPost), true, [], true] call CBA_fnc_addClassEventHandler;
} forEach ["Car", "Tank", "Air"];
}, [], 0.25] call CBA_fnc_waitAndExecute;
};
}] call CBA_fnc_addEventHandler;