ACE3/addons/safemode/XEH_postInit.sqf

22 lines
950 B
Plaintext
Raw Normal View History

2015-03-24 04:18:00 +00:00
// by esteldunedain
2015-01-18 20:56:12 +00:00
#include "script_component.hpp"
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
2015-01-17 20:32:34 +00:00
2015-04-13 03:44:19 +00:00
if (!hasInterface) exitWith {};
["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player} && {currentWeapon ACE_player != ""}) exitWith {false};
2015-01-18 20:01:18 +00:00
2015-03-05 07:32:26 +00:00
// Statement
[ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety);
true
}, {false}, [DIK_GRAVE, [false, true, false]], false] call CBA_fnc_addKeybind;
["unit", {
private _weaponSafe = currentWeapon ACE_player in (ACE_player getVariable [QGVAR(safedWeapons), []]);
[!_weaponSafe] call FUNC(setSafeModeVisual);
}] call CBA_fnc_addPlayerEventHandler;