ACE3/addons/hearing/initKeybinds.inc.sqf
johnb432 e535988479
Hearing - Code cleanup (#10041)
* Hearing cleanup

* Update fnc_updateHearingProtection.sqf

* Fixes + tweaks

* Update initSettings.inc.sqf

* Update fnc_removeEarplugs.sqf
2024-05-29 10:01:39 -07:00

19 lines
714 B
Plaintext

["ACE3 Equipment", QGVAR(putOrRemoveEarplugs), LLSTRING(PutOrRemoveEarplugs), {
// Conditions: specific
if !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
if (GVAR(enableCombatDeafness) && {!(ACE_player call FUNC(hasEarPlugsIn))} && {[ACE_player, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith {
[ACE_player, true] call FUNC(putInEarPlugs);
true // return
};
if (GVAR(enableCombatDeafness) && {ACE_player call FUNC(hasEarPlugsIn)}) exitWith {
[ACE_player, true] call FUNC(removeEarPlugs);
true // return
};
false // return
}] call CBA_fnc_addKeybind; // UNBOUND