client/addons/arsenal/functions/fnc_addGarageVehicle.sqf
Jacob Schmidt c6daf95415
All checks were successful
Build / Build (push) Successful in 53s
Initial Repo Setup
2025-01-01 14:35:12 -06:00

26 lines
668 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: IDSolutions
* Adds vehicle to player's garage unlocks and updates virtual garage
*/
params [["_class","",[""]],["_type",0,[0]]];
private _default = [[],[],[],[],[],[]];
private _garage_unlocks = GETVAR(player,Garage_Unlocks,_default);
private _index = (_garage_unlocks select _type) pushBackUnique _class;
if (_index > -1) then {
SETVAR(player,Garage_Unlocks,_garage_unlocks);
[[_class]] call FUNC(addVirtualVehs);
["garage",_garage_unlocks] call FUNC(updateUnlocks);
["garage"] call FUNC(saveUnlocks);
TRACE_2("Vehicle added to garage",_class,_type);
true
} else {
false
};