mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Allow disabling of buying or selling
Set price of the item to -1 in the Cfg traders files to disallow buying or selling
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
[NEW] Added new BRDM2, AN2, HMMWV, Mi17 and Cessna _DZ classes with radar disabled. #1746 @AirWavesMan
|
[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] 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] 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] 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)
|
[CHANGED] AmmoBoxSmall_556/762 is replaced with DZ_AmmoBoxUS/RU/EU/CZ and MedBox0 is replaced with DZ_MedBox (new model)
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ _counter = 0;
|
|||||||
_sellCurrency = "";
|
_sellCurrency = "";
|
||||||
_worth = 0;
|
_worth = 0;
|
||||||
_ignore = false;
|
_ignore = false;
|
||||||
|
_BcurrencyQty = _buy select 0;
|
||||||
|
_ScurrencyQty = _sell select 0;
|
||||||
if (dayz_classicBloodBagSystem && _y in dayz_typedBags) then {
|
if (dayz_classicBloodBagSystem && _y in dayz_typedBags) then {
|
||||||
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
||||||
};
|
};
|
||||||
@@ -58,9 +60,10 @@ _counter = 0;
|
|||||||
_buyCurrency = CurrencyName;
|
_buyCurrency = CurrencyName;
|
||||||
_sellCurrency = 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
|
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]];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ _totalPrice = 0;
|
|||||||
if (!_HasKey) exitWith {};
|
if (!_HasKey) exitWith {};
|
||||||
|
|
||||||
_worth = 0;
|
_worth = 0;
|
||||||
|
_currencyQty = _buy select 0;
|
||||||
if (!Z_SingleCurrency) then {
|
if (!Z_SingleCurrency) then {
|
||||||
_buyCurrency = _buy select 1;
|
_buyCurrency = _buy select 1;
|
||||||
_sellCurrency = _sell select 1;
|
_sellCurrency = _sell select 1;
|
||||||
@@ -103,8 +103,10 @@ _totalPrice = 0;
|
|||||||
_buyCurrency = CurrencyName;
|
_buyCurrency = CurrencyName;
|
||||||
_sellCurrency = CurrencyName;
|
_sellCurrency = CurrencyName;
|
||||||
};
|
};
|
||||||
|
if (_currencyQty < 0) then {_buyCurrency = "Unavailable";};
|
||||||
Z_SellableArray set [count(Z_SellableArray) , [_y, _type, _sell select 0, _text, _pic, _forEachIndex, _buy select 0, _sellCurrency, _buyCurrency, 0 ,_cat, _worth]];
|
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);
|
_totalPrice = _totalPrice + (_sell select 0);
|
||||||
};
|
};
|
||||||
} forEach _arrayOfTraderCat;
|
} forEach _arrayOfTraderCat;
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
CurrencyName,
|
CurrencyName,
|
||||||
[_sellPrice] call BIS_fnc_numberText,
|
if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
[_buyPrice] call BIS_fnc_numberText,
|
if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
CurrencyName,
|
CurrencyName,
|
||||||
_transportMaxWeapons,
|
_transportMaxWeapons,
|
||||||
_transportMaxMagazines,
|
_transportMaxMagazines,
|
||||||
@@ -58,10 +58,16 @@ if (Z_SingleCurrency) then {
|
|||||||
localize "STR_EPOCH_MAGS"
|
localize "STR_EPOCH_MAGS"
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = "";
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
if (_sellPrice >= 0) then {
|
||||||
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName');
|
_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 [
|
_formattedText = format [
|
||||||
"<img image='%1' size='3' align='center'/><br />" +
|
"<img image='%1' size='3' align='center'/><br />" +
|
||||||
@@ -75,8 +81,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
_buyCurrency,
|
_buyCurrency,
|
||||||
_sellPrice,
|
if (_sellPrice >= 0) then {_sellPrice} else {"";},
|
||||||
_buyPrice,
|
if (_buyPrice >= 0) then {_buyPrice} else {"";},
|
||||||
_sellCurrency,
|
_sellCurrency,
|
||||||
_transportMaxWeapons,
|
_transportMaxWeapons,
|
||||||
_transportMaxMagazines,
|
_transportMaxMagazines,
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
'lazy',
|
'lazy',
|
||||||
[_sellPrice] call BIS_fnc_numberText,
|
if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
[_buyPrice] call BIS_fnc_numberText,
|
if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
CurrencyName,
|
CurrencyName,
|
||||||
localize "STR_EPOCH_NAME",
|
localize "STR_EPOCH_NAME",
|
||||||
localize "STR_EPOCH_CLASS",
|
localize "STR_EPOCH_CLASS",
|
||||||
@@ -70,10 +70,16 @@ if (Z_SingleCurrency) then {
|
|||||||
localize "STR_EPOCH_PLAYER_291"
|
localize "STR_EPOCH_PLAYER_291"
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = "";
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
if (_sellPrice >= 0) then {
|
||||||
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName');
|
_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 [
|
_formattedText = format [
|
||||||
"<img image='%1' size='3' align='center'/><br />" +
|
"<img image='%1' size='3' align='center'/><br />" +
|
||||||
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%2</t><br />" +
|
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%2</t><br />" +
|
||||||
@@ -84,8 +90,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
'lazy',
|
'lazy',
|
||||||
_sellPrice,
|
if (_sellPrice >= 0) then {_sellPrice} else {"";},
|
||||||
_buyPrice,
|
if (_buyPrice >= 0) then {_buyPrice} else {"";},
|
||||||
_sellCurrency,
|
_sellCurrency,
|
||||||
_picSell,
|
_picSell,
|
||||||
_buyCurrency,
|
_buyCurrency,
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
_transportmaxBackpacks,
|
_transportmaxBackpacks,
|
||||||
[_sellPrice] call BIS_fnc_numberText,
|
if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
[_buyPrice] call BIS_fnc_numberText,
|
if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
CurrencyName,
|
CurrencyName,
|
||||||
_transportMaxWeapons,
|
_transportMaxWeapons,
|
||||||
_transportMaxMagazines,
|
_transportMaxMagazines,
|
||||||
@@ -155,10 +155,16 @@ if (Z_SingleCurrency) then {
|
|||||||
"\z\addons\dayz_code\gui\gear\gear_ui_slots_backpacks_white.paa"
|
"\z\addons\dayz_code\gui\gear\gear_ui_slots_backpacks_white.paa"
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = "";
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
if (_sellPrice >= 0) then {
|
||||||
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName');
|
_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 [
|
_formattedText = format [
|
||||||
"<img image='%1' size='3' /><br />" +
|
"<img image='%1' size='3' /><br />" +
|
||||||
@@ -174,8 +180,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
_transportmaxBackpacks,
|
_transportmaxBackpacks,
|
||||||
_sellPrice,
|
if (_sellPrice >= 0) then {_sellPrice} else {"";},
|
||||||
_buyPrice,
|
if (_buyPrice >= 0) then {_buyPrice} else {"";},
|
||||||
_buyCurrency,
|
_buyCurrency,
|
||||||
_transportMaxWeapons,
|
_transportMaxWeapons,
|
||||||
_transportMaxMagazines,
|
_transportMaxMagazines,
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
_magText,
|
_magText,
|
||||||
[_sellPrice] call BIS_fnc_numberText,
|
if (_sellPrice >= 0) then {[_sellPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
[_buyPrice] call BIS_fnc_numberText,
|
if (_buyPrice >= 0) then {[_buyPrice] call BIS_fnc_numberText;} else {"";},
|
||||||
CurrencyName,
|
CurrencyName,
|
||||||
localize "STR_EPOCH_NAME",
|
localize "STR_EPOCH_NAME",
|
||||||
localize "STR_EPOCH_CLASS",
|
localize "STR_EPOCH_CLASS",
|
||||||
@@ -81,11 +81,16 @@ if (Z_SingleCurrency) then {
|
|||||||
localize "STR_EPOCH_PLAYER_291"
|
localize "STR_EPOCH_PLAYER_291"
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = "";
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
if (_sellPrice >= 0) then {
|
||||||
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_buyCurrency = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'displayName');
|
_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 [
|
_formattedText = format [
|
||||||
"<img image='%1' size='3' align='center' /><br />" +
|
"<img image='%1' size='3' align='center' /><br />" +
|
||||||
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%2</t><br />" +
|
"<t color='#33BFFF' size='0.7'>%11: </t><t color='#ffffff' size='0.7'>%2</t><br />" +
|
||||||
@@ -96,8 +101,8 @@ if (Z_SingleCurrency) then {
|
|||||||
_display,
|
_display,
|
||||||
_class,
|
_class,
|
||||||
_magText,
|
_magText,
|
||||||
_sellPrice,
|
if (_sellPrice >= 0) then {_sellPrice} else {"";},
|
||||||
_buyPrice,
|
if (_buyPrice >= 0) then {_buyPrice} else {"";},
|
||||||
_sellCurrency,
|
_sellCurrency,
|
||||||
_buyCurrency,
|
_buyCurrency,
|
||||||
_picSell,
|
_picSell,
|
||||||
|
|||||||
@@ -33,5 +33,9 @@ _count = 0;
|
|||||||
|
|
||||||
if (_count > 0) then {
|
if (_count > 0) then {
|
||||||
lbSetColor [Z_AT_BUYABLELIST, _index, [0, 1, 0, 1]];
|
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;
|
} count Z_BuyableArray;
|
||||||
|
|||||||
@@ -9,4 +9,7 @@ private "_index";
|
|||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_SELLABLELIST, _x select 3];
|
_index = lbAdd [Z_AT_SELLABLELIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_SELLABLELIST, _index, _x select 4 ];
|
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;
|
} count Z_SellableArray;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (count _this > 0) then {
|
|||||||
_query = _this select 0; // the search string.
|
_query = _this select 0; // the search string.
|
||||||
if (Z_Selling) then {
|
if (Z_Selling) then {
|
||||||
if (count Z_SellArray > 0) exitWith {}; //Do not filter if items already in selling list (dupes)
|
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 = [];
|
_newSellArray = [];
|
||||||
{
|
{
|
||||||
if (_x find Z_SellArray < 0) then {
|
if (_x find Z_SellArray < 0) then {
|
||||||
@@ -37,7 +37,7 @@ if (count _this > 0) then {
|
|||||||
call Z_fillSellList;
|
call Z_fillSellList;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (isNil '_query' || _query == "") then {
|
if (isNil '_query' || {_query == ""}) then {
|
||||||
Z_BuyableArray = [] + Z_OriginalBuyableArray;
|
Z_BuyableArray = [] + Z_OriginalBuyableArray;
|
||||||
call Z_clearBuyList;
|
call Z_clearBuyList;
|
||||||
call Z_fillBuyableList;
|
call Z_fillBuyableList;
|
||||||
|
|||||||
@@ -3,11 +3,15 @@ private ["_amount","_index","_index2","_temp"];
|
|||||||
|
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
_amount = parseNumber(_this select 1);
|
_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 = [] + (Z_BuyableArray select _index);
|
||||||
_temp set [9,(ceil _amount)];
|
_temp set [9,(ceil _amount)];
|
||||||
Z_BuyingArray set [count(Z_BuyingArray),_temp];
|
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];
|
lbSetPicture [Z_AT_BUYINGLIST, _index2, _temp select 4];
|
||||||
call Z_calcPrice;
|
call Z_calcPrice;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user