ACE3/addons/grenades/XEH_postInit.sqf

35 lines
1.3 KiB
Plaintext
Raw Normal View History

// by commy2
#include "script_component.hpp"
["ace_flashbangExploded", LINKFUNC(flashbangExplosionEH)] call CBA_fnc_addEventHandler;
// Register fired event handlers
["ace_firedPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler;
["ace_firedPlayerNonLocal", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler;
["ace_firedNonPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler;
if (!hasInterface) exitWith {};
GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265];
GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
// Add keybinds
2016-07-13 22:01:14 +00:00
["ACE3 Weapons", QGVAR(switchGrenadeMode), localize LSTRING(SwitchGrenadeMode), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false};
// Don't change mode or show hint if advanced throwing is active
if (ACE_player getVariable [QEGVAR(advanced_throwing,inHand), false]) exitWith {false};
2015-03-05 07:32:26 +00:00
// Statement
[] call FUNC(nextMode);
2016-07-13 22:01:14 +00:00
}, {false}, [9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key
["CBA_settingsInitialized", {
if (GVAR(convertExplosives)) then {
[] call FUNC(addChangeFuseItemContextMenuOptions);
};
}] call CBA_fnc_addEventHandler;