diff --git a/CHANGE LOG 1.0.6.txt b/CHANGE LOG 1.0.6.txt index 7ec69ee1f..9481f7d16 100644 --- a/CHANGE LOG 1.0.6.txt +++ b/CHANGE LOG 1.0.6.txt @@ -46,6 +46,7 @@ [NEW] Added new BRDM2, AN2, HMMWV, Mi17 and Cessna _DZ classes with radar disabled. #1746 @AirWavesMan [NEW] Added SCAR Mk16 and Mk17 variants, L86 and AA12 to loot tables and traders. #1743 @AirWavesMan [NEW] Players can now manually push stuck planes backwards to free them. @ebaydayz +[NEW] You may set the buying or selling price of any item to -1 to disallow the respective trading action, only with config traders and advanced trading @icomrade [CHANGED] Combattimeout now uses diag_tickTime instead of time. [CHANGED] AmmoBoxSmall_556/762 is replaced with DZ_AmmoBoxUS/RU/EU/CZ and MedBox0 is replaced with DZ_MedBox (new model) 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 fb7c53737..4eabfa72b 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf @@ -29,6 +29,8 @@ _counter = 0; _sellCurrency = ""; _worth = 0; _ignore = false; + _BcurrencyQty = _buy select 0; + _ScurrencyQty = _sell select 0; if (dayz_classicBloodBagSystem && _y in dayz_typedBags) then { if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;}; }; @@ -58,9 +60,10 @@ _counter = 0; _buyCurrency = CurrencyName; _sellCurrency = CurrencyName; }; - + if (_BcurrencyQty < 0) then {_buyCurrency = "Unavailable"; _ignore = true;}; + if (_ScurrencyQty < 0) then {_sellCurrency = "Unavailable";}; if (!_ignore) then { // Fill buyable list for one category only - Z_BuyableArray set [count Z_BuyableArray, [_y,_type,_buy select 0,_text,_pic,_forEachIndex,_sell select 0, _buyCurrency, _sellCurrency, 0,_cat, _worth]]; + Z_BuyableArray set [count Z_BuyableArray, [_y,_type,_BcurrencyQty,_text,_pic,_forEachIndex, _ScurrencyQty, _buyCurrency, _sellCurrency, 0,_cat, _worth]]; }; }; }; 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 d89aef549..984bea9c2 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_checkArrayInConfig.sqf @@ -92,7 +92,7 @@ _totalPrice = 0; if (!_HasKey) exitWith {}; _worth = 0; - + _currencyQty = _buy select 0; if (!Z_SingleCurrency) then { _buyCurrency = _buy select 1; _sellCurrency = _sell select 1; @@ -103,8 +103,10 @@ _totalPrice = 0; _buyCurrency = CurrencyName; _sellCurrency = CurrencyName; }; - - Z_SellableArray set [count(Z_SellableArray) , [_y, _type, _sell select 0, _text, _pic, _forEachIndex, _buy select 0, _sellCurrency, _buyCurrency, 0 ,_cat, _worth]]; + if (_currencyQty < 0) then {_buyCurrency = "Unavailable";}; + if ((_sell select 0) >= 0) then { + Z_SellableArray set [count(Z_SellableArray) , [_y, _type, _sell select 0, _text, _pic, _forEachIndex, _currencyQty, _sellCurrency, _buyCurrency, 0 ,_cat, _worth]]; + }; _totalPrice = _totalPrice + (_sell select 0); }; } forEach _arrayOfTraderCat; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf index d87378004..c6e5f623b 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayBackpackInfo.sqf @@ -45,8 +45,8 @@ if (Z_SingleCurrency) then { _display, _class, CurrencyName, - [_sellPrice] call BIS_fnc_numberText, - [_buyPrice] call BIS_fnc_numberText, + if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";}, + if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";}, CurrencyName, _transportMaxWeapons, _transportMaxMagazines, @@ -58,10 +58,16 @@ if (Z_SingleCurrency) then { localize "STR_EPOCH_MAGS" ]; } else { - _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); - _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); - _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); - _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + _picSell = ""; + if (_sellPrice >= 0) then { + _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); + _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); + }; + _picBuy = ""; + if (_buyPrice >= 0) then { + _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); + _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + }; _formattedText = format [ "
" + @@ -75,8 +81,8 @@ if (Z_SingleCurrency) then { _display, _class, _buyCurrency, - _sellPrice, - _buyPrice, + if (_sellPrice >= 0) then {_sellPrice} else {"";}, + if (_buyPrice >= 0) then {_buyPrice} else {"";}, _sellCurrency, _transportMaxWeapons, _transportMaxMagazines, diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayItemInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayItemInfo.sqf index 48fe7d261..e1b50091b 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayItemInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayItemInfo.sqf @@ -61,8 +61,8 @@ if (Z_SingleCurrency) then { _display, _class, 'lazy', - [_sellPrice] call BIS_fnc_numberText, - [_buyPrice] call BIS_fnc_numberText, + if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";}, + if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";}, CurrencyName, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", @@ -70,10 +70,16 @@ if (Z_SingleCurrency) then { localize "STR_EPOCH_PLAYER_291" ]; } else { - _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); - _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); - _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); - _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + _picSell = ""; + if (_sellPrice >= 0) then { + _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); + _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); + }; + _picBuy = ""; + if (_buyPrice >= 0) then { + _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); + _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + }; _formattedText = format [ "
" + "%11: %2
" + @@ -84,8 +90,8 @@ if (Z_SingleCurrency) then { _display, _class, 'lazy', - _sellPrice, - _buyPrice, + if (_sellPrice >= 0) then {_sellPrice} else {"";}, + if (_buyPrice >= 0) then {_buyPrice} else {"";}, _sellCurrency, _picSell, _buyCurrency, diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf index 3f00a5e01..763e54ef6 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayVehicleInfo.sqf @@ -129,8 +129,8 @@ if (Z_SingleCurrency) then { _display, _class, _transportmaxBackpacks, - [_sellPrice] call BIS_fnc_numberText, - [_buyPrice] call BIS_fnc_numberText, + if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";}, + if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";}, CurrencyName, _transportMaxWeapons, _transportMaxMagazines, @@ -155,10 +155,16 @@ if (Z_SingleCurrency) then { "\z\addons\dayz_code\gui\gear\gear_ui_slots_backpacks_white.paa" ]; } else { - _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); - _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); - _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); - _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + _picSell = ""; + if (_sellPrice >= 0) then { + _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); + _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); + }; + _picBuy = ""; + if (_buyPrice >= 0) then { + _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); + _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + }; _formattedText = format [ "
" + @@ -174,8 +180,8 @@ if (Z_SingleCurrency) then { _display, _class, _transportmaxBackpacks, - _sellPrice, - _buyPrice, + if (_sellPrice >= 0) then {_sellPrice} else {"";}, + if (_buyPrice >= 0) then {_buyPrice} else {"";}, _buyCurrency, _transportMaxWeapons, _transportMaxMagazines, diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayWeaponInfo.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayWeaponInfo.sqf index c0f206349..6ff3e52c2 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayWeaponInfo.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_displayWeaponInfo.sqf @@ -72,8 +72,8 @@ if (Z_SingleCurrency) then { _display, _class, _magText, - [_sellPrice] call BIS_fnc_numberText, - [_buyPrice] call BIS_fnc_numberText, + if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";}, + if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";}, CurrencyName, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", @@ -81,11 +81,16 @@ if (Z_SingleCurrency) then { localize "STR_EPOCH_PLAYER_291" ]; } else { - _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); - _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); - _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); - _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); - + _picSell = ""; + if (_sellPrice >= 0) then { + _picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture'); + _sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName'); + }; + _picBuy = ""; + if (_buyPrice >= 0) then { + _picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture'); + _buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName'); + }; _formattedText = format [ "
" + "%11: %2
" + @@ -96,8 +101,8 @@ if (Z_SingleCurrency) then { _display, _class, _magText, - _sellPrice, - _buyPrice, + if (_sellPrice >= 0) then {_sellPrice} else {"";}, + if (_buyPrice >= 0) then {_buyPrice} else {"";}, _sellCurrency, _buyCurrency, _picSell, 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 5f261ea97..e12e54163 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillBuyableList.sqf @@ -33,5 +33,9 @@ _count = 0; if (_count > 0) then { lbSetColor [Z_AT_BUYABLELIST, _index, [0, 1, 0, 1]]; + } else { + if ((_x select 6) < 0) then { //color items only allowed to either be sold or purchased + lbSetColor [Z_AT_BUYABLELIST, _index, [0, 0.57, 1, 1]]; + }; }; } count Z_BuyableArray; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillSellList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillSellList.sqf index 7adb7889f..d8628b37b 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillSellList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_fillSellList.sqf @@ -9,4 +9,7 @@ private "_index"; { _index = lbAdd [Z_AT_SELLABLELIST, _x select 3]; lbSetPicture [Z_AT_SELLABLELIST, _index, _x select 4 ]; + if ((_x select 6) < 0) then { //color items only allowed to either be sold or purchased + lbSetColor [Z_AT_SELLABLELIST, _index, [0, 0.57, 1, 1]]; + }; } count Z_SellableArray; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf index 713a6d68e..64e541035 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf @@ -11,7 +11,7 @@ if (count _this > 0) then { _query = _this select 0; // the search string. if (Z_Selling) then { if (count Z_SellArray > 0) exitWith {}; //Do not filter if items already in selling list (dupes) - if (isNil '_query' || _query == "") then { + if (isNil '_query' || {_query == ""}) then { _newSellArray = []; { if (_x find Z_SellArray < 0) then { @@ -37,7 +37,7 @@ if (count _this > 0) then { call Z_fillSellList; }; } else { - if (isNil '_query' || _query == "") then { + if (isNil '_query' || {_query == ""}) then { Z_BuyableArray = [] + Z_OriginalBuyableArray; call Z_clearBuyList; call Z_fillBuyableList; diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_toBuyingList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_toBuyingList.sqf index c5b0ee779..4bf2c561f 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_toBuyingList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_toBuyingList.sqf @@ -3,11 +3,15 @@ private ["_amount","_index","_index2","_temp"]; _index = _this select 0; _amount = parseNumber(_this select 1); -if (!isNil"_index" && _index > -1 && (typeName _amount == "SCALAR") && _amount > 0) then { +if (!isNil"_index" && _index > -1 && (typeName _amount == "SCALAR")) then { _temp = [] + (Z_BuyableArray select _index); _temp set [9,(ceil _amount)]; Z_BuyingArray set [count(Z_BuyingArray),_temp]; - _index2 = lbAdd [Z_AT_BUYINGLIST, format["%1x: %2",_temp select 9,_temp select 3]]; + if (_amount > 0) then { + _index2 = lbAdd [Z_AT_BUYINGLIST, format["%1x: %2",_temp select 9,_temp select 3]]; + } else { + _index2 = lbAdd [Z_AT_BUYINGLIST, "This trader does not sell this item"]; + }; lbSetPicture [Z_AT_BUYINGLIST, _index2, _temp select 4]; call Z_calcPrice; };