Fix Advanced Trading Selling + new Var

New variable to configure whether or not the player will need to key to
sell a vehicle. DZE_SaleRequiresKey = false;
This commit is contained in:
icomrade
2016-07-23 01:16:37 -04:00
parent 855a72ca1f
commit 9c4e30ea08
4 changed files with 6 additions and 6 deletions

View File

@@ -41,7 +41,7 @@ _HasKeyCheck = {
};
} count _inventory;
};
true; //change to _keyFound; to require key to sell vehicle
_keyFound;
};
_totalPrice = 0;
if(_total > 0)then{
@@ -83,7 +83,7 @@ if(_total > 0)then{
};
_HasKey = true;
if (_vehTrade && {(typeOf Z_vehicle) == _y}) then {
if (!(_type in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"])) then {
if (!(_type in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"]) && DZE_SaleRequiresKey) then {
_HasKey = [Z_vehicle, _all] call _HasKeyCheck;
};
};

View File

@@ -20,7 +20,7 @@ _deleteTradedVehicle = {
_VehKey2 = (_this select 0) select 0;
_delType = _this select 1;
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 ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"] || !DZE_SaleRequiresKey) then {
_localResult2 = 1;
} else {
{
@@ -31,7 +31,6 @@ _deleteTradedVehicle = {
};
} forEach (items player);
};
_localResult2 = 1; //comment out to require key to sell vehicles
if (isNil "_localResult2") then {
_localResult2 = 0;
} else {

View File

@@ -13,7 +13,7 @@ _weaps = _this select 2;
_bags = [];
_vehInfo = [];
_keyID = 0;
_deleteVeh = true; //set to false to require key to sell vehicles
_deleteVeh = false;
if(count _this > 3) then {
if (count (_this select 3) > 0) then {
@@ -117,7 +117,7 @@ if (count _vehInfo > 0) then {
};
};
} count _normalWeaps;
if (_keyID == "0") then {_deleteVeh = True;};
if (_keyID == "0" || !DZE_SaleRequiresKey) then {_deleteVeh = True;};
} else {
_deleteVeh = True;
};

View File

@@ -50,6 +50,7 @@ DZE_GodModeBaseExclude = []; //Array of object class names excluded from the god
DZE_advancedTrading = true; //Use advanced trading system. WARNING: set to false if you use database traders, you should use config-traders anyway!
DZE_serverLogTrades = true; // Log trades to server RPT (sent with publicVariableServer on every trade)
DZE_GemWorthArray = [["ItemTopaz",15000], ["ItemObsidian",20000], ["ItemSapphire",25000], ["ItemAmethyst",30000], ["ItemEmerald",35000], ["ItemCitrine",40000], ["ItemRuby",45000]]; //array of gem prices, works only in advanced trading
DZE_SaleRequiresKey = false; //Require the player has the key for a vehicle in oreder to sell it. The key can be in the player's toolbelt or backpack, or the vehicle's inventory. False by default
Z_AT_FolderLocation = '\z\addons\dayz_code\actions\AdvancedTrading';
Z_VehicleDistance = 40; // Distance that a vehicle needs to be to see it's content or to sell it.
Z_SingleCurrency = false; // Does your server use a single currency system.