ACE3/addons/weaponselect/XEH_postInit.sqf

202 lines
7.6 KiB
Plaintext
Raw Normal View History

2015-03-24 04:18:00 +00:00
// by esteldunedain
2015-01-18 14:30:57 +00:00
#include "script_component.hpp"
if (!hasInterface) exitWith {};
2015-01-18 14:30:57 +00:00
2015-09-27 06:51:42 +00:00
// add keybinds
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
[ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode);
2015-04-20 19:10:56 +00:00
false
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 1 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode);
2015-04-20 19:10:56 +00:00
false
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 2 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
[ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle);
2015-04-20 19:10:56 +00:00
false
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 3 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
[ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode);
2015-04-20 19:10:56 +00:00
false
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 4 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
[ACE_player, binocular ACE_player] call FUNC(selectWeaponMode);
2015-04-20 19:10:56 +00:00
false
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 5 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
2015-09-27 15:15:59 +00:00
[ACE_player, 1] call FUNC(selectNextGrenade);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[7, [false, false, false]], false] call CBA_fnc_addKeybind; //6 Key
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
2015-09-27 15:15:59 +00:00
[ACE_player, 2] call FUNC(selectNextGrenade);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[8, [false, false, false]], false] call CBA_fnc_addKeybind; //7 Key
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, ACE_player, ["isNotInside", "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};
// Statement
2015-06-07 17:59:53 +00:00
if ((currentWeapon ACE_player) != "") then {
[ACE_player] call FUNC(putWeaponAway);
} else {
2016-01-06 21:42:02 +00:00
private _weapon = switch (true) do {
2015-06-07 17:59:53 +00:00
case ((primaryWeapon ACE_player) != ""): {primaryWeapon ACE_player};
case ((handgunWeapon ACE_player) != ""): {handgunWeapon ACE_player};
case ((secondaryWeapon ACE_player) != ""): {secondaryWeapon ACE_player};
default {""};
};
if (_weapon != "") then {ACE_player selectWeapon _weapon};
};
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[11, [false, false, false]], false] call CBA_fnc_addKeybind; //0 Key
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !((ACE_player != vehicle ACE_player) && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false};
2015-03-05 07:32:26 +00:00
// Statement
vehicle ACE_player engineOn true;
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[3, [false, false, false]], false] call CBA_fnc_addKeybind; //2 Key
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false};
// Statement
vehicle ACE_player engineOn false;
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[2, [false, false, false]], false] call CBA_fnc_addKeybind; //1 Key
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 3 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 4 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !(ACE_player != vehicle ACE_player) exitWith {false};
// Statement
[ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[0, [false, false, false]], false] call CBA_fnc_addKeybind; //Unbound (was 5 Key)
2015-03-05 07:32:26 +00:00
2015-09-27 12:55:36 +00:00
["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
// Conditions: specific
if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false};
// Statement
[vehicle ACE_player] call FUNC(fireSmokeLauncher);
true
2015-03-05 07:32:26 +00:00
},
2015-03-05 08:51:24 +00:00
{false},
2015-09-27 12:55:36 +00:00
[10, [false, false, false]], false] call CBA_fnc_addKeybind; //9 Key
2016-02-06 21:27:43 +00:00
// Register fire event handler
["firedPlayer", DFUNC(throwGrenade)] call EFUNC(common,addEventHandler);