From c3502d6dccdccca8927c2aeb96773331bdcb1053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20E=C4=9Fitmen?= Date: Sun, 2 Sep 2018 15:30:40 +0300 Subject: [PATCH] Add addDefaultLoadout function --- addons/arsenal/XEH_PREP.hpp | 1 + .../functions/fnc_addDeafultLoadout.sqf | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 addons/arsenal/functions/fnc_addDeafultLoadout.sqf diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 98753b070c..233abc56f8 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -1,3 +1,4 @@ +PREP(addDefaultLoadout); PREP(addListBoxItem); PREP(addStat); PREP(addVirtualItems); diff --git a/addons/arsenal/functions/fnc_addDeafultLoadout.sqf b/addons/arsenal/functions/fnc_addDeafultLoadout.sqf new file mode 100644 index 0000000000..3d3c003a4c --- /dev/null +++ b/addons/arsenal/functions/fnc_addDeafultLoadout.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" +/* + * Author: 654wak654 + * Adds a loadout to the "Default Loadouts" list. + * + * Arguments: + * 0: Name of loadout + * 1: getUnitLoadout array + * + * Return Value: + * None + * + * Example: + * ["Squad Leader", getUnitLoadout sql1] call ace_arsenal_fnc_addDefaultLoadout + * + * Public: Yes +*/ + +params [["_name", "", [""]], ["_loadout", [], [[]], 10]; + +GVAR(defaultLoadoutsList) append [_name, _loadout];