diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf index ac02faa26..d2ced9bf2 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/DZE_deleteTradedVehicle.sqf @@ -17,7 +17,7 @@ _containerFindKey = { }; if ((count _VehKey2) > 0) then { - if ((_VehKey2 select 0) == "0" || _delType in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"]) then { + if ((_VehKey2 select 0) == "0" || _delType in DZE_tradeVehicleKeyless) then { _localResult2 = 1; } else { { diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf index 3d6e23e06..c6392dce7 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_buyItems.sqf @@ -48,7 +48,7 @@ if (Z_SingleCurrency) then { _backpacksToBuy = _backpacksToBuy + (_x select 9) ; _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount }; - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _vehiclesToBuy = _vehiclesToBuy + (_x select 9) ; _priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount }; @@ -86,7 +86,7 @@ if (Z_SingleCurrency) then { _backpacksToBuy = _backpacksToBuy + (_x select 9) ; _priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); }; - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _vehiclesToBuy = _vehiclesToBuy + (_x select 9) ; _priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); }; @@ -128,7 +128,7 @@ if (_enoughMoney) then { _buyingType = _this select 1; _keySelected = "0"; _isKeyOK= false; - if (_buyingType in ["trade_any_vehicle_free", "trade_any_bicycle", "trade_any_bicycle_old"]) then { + if (_buyingType in DZE_tradeVehicleKeyless) then { _isKeyOK = true; } else { _keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom; @@ -152,7 +152,7 @@ if (_enoughMoney) then { _near = nearestObjects [player,[_part_out],50]; [_part_out,_sign,_near] spawn fn_waitForObject; - if (_buyingType in ["trade_any_vehicle_free", "trade_any_bicycle", "trade_any_bicycle_old"]) then { + if (_buyingType in DZE_tradeVehicleKeyless) then { PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,"0",_activatingPlayer]; } else { PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer]; @@ -173,7 +173,7 @@ if (_enoughMoney) then { if (_x select 1 == "trade_items") then { _backpack addMagazineCargoGlobal [_x select 0, _x select 9]; }; - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _item2Add = [(_x select 0), (_x select 1)] call _buyVehicle; if (_item2Add != "0") then { _backpack addWeaponCargoGlobal [_item2Add, 1]; @@ -195,7 +195,7 @@ if (_enoughMoney) then { if (_x select 1 == "trade_backpacks") then { Z_vehicle addBackpackCargoGlobal [_x select 0, _x select 9]; }; - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _item2Add = [(_x select 0), (_x select 1)] call _buyVehicle; if (_item2Add != "0") then { Z_vehicle addWeaponCargoGlobal [_item2Add, 1]; @@ -231,7 +231,7 @@ if (_enoughMoney) then { if (_x select 1 == "trade_backpacks") then { player addBackpack (_x select 0); }; - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _item2Add = [(_x select 0), (_x select 1)] call _buyVehicle; if (_item2Add != "0") then { player addWeapon _item2Add; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf index aa882a861..fb7c53737 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf @@ -41,7 +41,7 @@ _counter = 0; _pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture'); _text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName'); }; - if (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if (_type in DZE_tradeObject) then { _pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture'); _text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName'); }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf index 65821ef7b..d89aef549 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf @@ -75,7 +75,7 @@ _totalPrice = 0; _pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture'); _text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName'); }; - case (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) : + case (_type in DZE_tradeObject) : { _pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture'); _text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName'); @@ -85,7 +85,7 @@ _totalPrice = 0; if (isNil '_text') then { _text = _y; }; _HasKey = true; if (_vehTrade && {(typeOf Z_vehicle) == _y}) then { - if (!(_type in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"]) && DZE_SaleRequiresKey) then { + if (!(_type in DZE_tradeVehicleKeyless) && DZE_SaleRequiresKey) then { _HasKey = [Z_vehicle, _all] call _HasKeyCheck; }; }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf index e49538e9f..5f261ea97 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf @@ -12,7 +12,7 @@ _count = 0; _name = _x select 0; _type = _x select 1; - if (_type in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if (_type in DZE_tradeVehicle) then { _count = { local _x } count (nearestObjects [(getPosATL player), [_name], Z_VehicleDistance]); }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getItemConfig.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getItemConfig.sqf index 623a38d75..11713204c 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getItemConfig.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_getItemConfig.sqf @@ -17,7 +17,7 @@ switch (true) do { { [_item] call Z_displayBackpackInfo; }; - case (_type in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) : + case (_type in DZE_tradeVehicle) : { [_item] call Z_displayVehicleInfo; }; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf index 90509deee..005bf6ef7 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_sellItems.sqf @@ -88,7 +88,7 @@ _sellVehicle = { _bpArray set [count(_bpArray),_name]; _bpCheckArray set [count(_bpCheckArray),[_x select 2, _x select 11]]; }; - case (_type in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) : + case (_type in DZE_tradeVehicle) : { if (local Z_vehicle) then { _VehKey = [Z_vehicle, _type] call _sellVehicle; @@ -125,7 +125,7 @@ if (Z_SellingFrom == 2) then { _bagTraded = false; { - if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then { + if ((_x select 1) in DZE_tradeVehicle) then { _localResult = [_vehArray, (_x select 1)] call DZE_deleteTradedVehicle; if (_localResult == 1) then {_vehTraded = true;}; } else { diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index ce8f55ca9..9d5cc6427 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -516,6 +516,9 @@ DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ" DZE_isDestroyableStorage = ["OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ","StorageShed_DZ","GunRack_DZ","WoodCrate_DZ"]; helperDetach = false; DZE_snapExtraRange = 0; +DZE_tradeVehicle = ["trade_any_vehicle","trade_any_vehicle_free","trade_any_vehicle_old","trade_any_bicycle","trade_any_bicycle_old","trade_any_boat","trade_any_boat_old"]; +DZE_tradeVehicleKeyless = ["trade_any_bicycle","trade_any_bicycle_old","trade_any_vehicle_free"]; +DZE_tradeObject = DZE_tradeVehicle + ["trade_backpacks"]; if (isNil "DZE_plotOwnershipExclusions") then { DZE_plotTakeOwnershipItems = DayZ_SafeObjects - (DZE_LockableStorage + ["Plastic_Pole_EP1_DZ","DZ_storage_base"]); };