ACE3/addons/safemode/XEH_postInit.sqf

25 lines
910 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"
2015-01-17 20:32:34 +00:00
2015-04-13 03:44:19 +00:00
if (!hasInterface) exitWith {};
2015-04-17 23:13:09 +00:00
// IGNORE_PRIVATE_WARNING(_player)
2015-01-17 20:32:34 +00:00
//["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler);
2015-03-05 07:32:26 +00:00
//@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
2015-01-18 20:01:18 +00:00
// Add keybinds
2015-03-05 07:32:26 +00:00
["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode",
{
// Conditions: canInteract
2015-03-20 22:55:39 +00:00
if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !([ACE_player] call EFUNC(common,canUseWeapon)) 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
},
2015-03-05 08:51:24 +00:00
{false},
2015-03-05 07:32:26 +00:00
[41, [false, true, false]], false] call cba_fnc_addKeybind;