mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
31 lines
921 B
Plaintext
31 lines
921 B
Plaintext
|
#include "script_component.hpp"
|
||
|
|
||
|
[] call FUNC(initItemContextMenu);
|
||
|
|
||
|
addUserActionEventHandler ["headlights", "Deactivate", FUNC(onLightToggled)];
|
||
|
|
||
|
["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), {
|
||
|
ACE_player action ["GunLightOn", ACE_player];
|
||
|
ACE_player action ["IRLaserOn", ACE_player];
|
||
|
[] call FUNC(onLightToggled);
|
||
|
true
|
||
|
}, {
|
||
|
ACE_player action ["GunLightOff", ACE_player];
|
||
|
ACE_player action ["IRLaserOff", ACE_player];
|
||
|
[] call FUNC(onLightToggled);
|
||
|
true
|
||
|
}] call CBA_fnc_addKeybind;
|
||
|
|
||
|
["CBA_attachmentSwitched", {
|
||
|
params ["", "", "_item"];
|
||
|
|
||
|
private _substr = _item select [0, 8];
|
||
|
if (
|
||
|
ACE_player getVariable [QGVAR(isTurnedOn), false]
|
||
|
&& {_substr == "ACE_SPIR" || {_substr == "ACE_DBAL"}}
|
||
|
) then {
|
||
|
ACE_player action ["GunLightOn", ACE_player];
|
||
|
ACE_player action ["IRLaserOn", ACE_player];
|
||
|
};
|
||
|
}] call CBA_fnc_addEventHandler;
|