#include "..\script_component.hpp" /* * Function: forge_client_arsenal_fnc_addVirtualVehicles * Author: IDSolutions * * [Description] * Adds vehicles to virtual garage and categorizes them by type * * Arguments: * 0: Vehicles - Array of vehicle classnames * * Return Value: * None * * Examples: * ["B_T_LSV_01_unarmed_F", "car"] call forge_client_arsenal_fnc_addVirtualVehicles * * Public: Yes */ params [["_vehicles", [], [[]]]]; private _default = [[],[],[],[],[],[]]; private _garage_unlocks = GETVAR(player,Garage_Unlocks,_default); private _cars = _garage_unlocks select 0; private _armor = _garage_unlocks select 1; private _helis = _garage_unlocks select 2; private _planes = _garage_unlocks select 3; private _naval = _garage_unlocks select 4; private _static = _garage_unlocks select 5; { switch true do { case (_x isKindOf "Car"): { if ((_x isKindOf "Tank") || (_x isKindOf "Wheeled_APC_F")) exitWith {}; _cars pushBackUnique _x; }; case (_x isKindOf "Tank"): { _armor pushBackUnique _x; }; case (_x isKindOf "Helicopter"): { _helis pushBackUnique _x; }; case (_x isKindOf "Plane"): { _planes pushBackUnique _x; }; case (_x isKindOf "Ship"): { _naval pushBackUnique _x; }; case (_x isKindOf "Static"): { _static pushBackUnique _x; }; }; } forEach _vehicles; GVAR(car_unlocks) = []; GVAR(armor_unlocks) = []; GVAR(heli_unlocks) = []; GVAR(plane_unlocks) = []; GVAR(naval_unlocks) = []; GVAR(static_unlocks) = []; { GVAR(car_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _cars; { GVAR(armor_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _armor; { GVAR(heli_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _helis; { GVAR(plane_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _planes; { GVAR(naval_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _naval; { GVAR(static_unlocks) append [getText(configFile >> "CfgVehicles" >> _x >> "model"),[configFile >> "CfgVehicles" >> _x]]; } forEach _static; TRACE_1("Virtual vehicles updated",count _vehicles);