client/addons/store/functions/fnc_buyVehicle.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

19 lines
668 B
Plaintext

#include "..\script_component.hpp"
params ["_item", "_price", "_itemType"];
private _displayName = getText (configFile >> "CfgVehicles" >> _item >> "displayName");
// private _garage = player getVariable ["FORGE_Garage", []];
private _garage = GETVAR(player,FORGE_Garage,[]);
private _itemData = [[], 1, 0];
if !([_price] call FUNC(handlePurchase)) exitWith {};
_garage pushBack [true, _item, _itemData];
// player setVariable ["FORGE_Garage", _garage, true];
SETPVAR(player,FORGE_Garage,_garage);
[_item, _itemType] call EFUNC(armory,addVehArmory);
[format ["You have purchased %1 for $%2.", _displayName, _price], "info", 3, "right"] call EFUNC(misc,notify);