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:
icomrade
2016-09-03 14:26:43 -04:00
parent 1b60d0d963
commit ffef031863
11 changed files with 82 additions and 42 deletions

View File

@@ -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 [
"<img image='%1' size='3' /><br />" +
@@ -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,