#include "..\script_component.hpp" /* * Author: IDSolutions * Adds item to player's armory unlocks and updates virtual arsenal */ params [["_class","",[""]],["_type",0,[0]]]; private _default = [[],[],[],[]]; private _armory_unlocks = GETVAR(player,Armory_Unlocks,_default); private _index = (_armory_unlocks select _type) pushBackUnique _class; if (_index > -1) then { SETVAR(player,Armory_Unlocks,_armory_unlocks); if (GVAR(armory_type) == 0) then { [GVAR(gear_box),[_class],false,true,1,_type] call BFUNC(addVirtualItemCargo); } else { [GVAR(gear_box),[_class]] call AFUNC(arsenal,addVirtualItems); }; ["armory",_armory_unlocks] call FUNC(updateUnlocks); ["armory"] call FUNC(saveUnlocks); TRACE_2("Item added to armory",_class,_type); true } else { false };