mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Consolidate duplicate sell distance variables
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
- dayz_combat --> no longer exists use (player getVariable["combattimeout",0] >= diag_tickTime)
|
||||
- dayz_fullMoonNights --> dayz_ForcefullmoonNights
|
||||
- dayz_MapArea --> no longer exists (was only used for DynamicVehicleArea and HeliCrashArea)
|
||||
- dayz_sellDistance_vehicle, dayz_sellDistance_boat, dayz_sellDistance_air --> Z_VehicleDistance
|
||||
- dayz_updateObjects --> DayZ_GearedObjects
|
||||
- DynamicVehicleArea --> (getMarkerSize "center") select 1
|
||||
- DZE_ActionInProgress --> dayz_actionInProgress
|
||||
|
||||
@@ -64,15 +64,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -141,18 +133,9 @@ if (_finished) then {
|
||||
} else {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
} else {
|
||||
//sell
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -71,7 +71,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -149,18 +141,9 @@ if (_finished) then {
|
||||
} else {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
} else {
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -76,7 +76,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_boat];
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -149,17 +141,8 @@ if (_finished) then {
|
||||
format[localize "str_epoch_player_183",_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -68,15 +68,7 @@ if (_finished) then {
|
||||
|
||||
_canAfford = false;
|
||||
if(_bos == 1) then {
|
||||
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], _distance]);
|
||||
_count = {(typeOf _x) == _part_in} count (nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance]);
|
||||
if (_count >= _qty_in) then {
|
||||
_canAfford = true;
|
||||
};
|
||||
@@ -145,15 +137,7 @@ if (_finished) then {
|
||||
} else {
|
||||
|
||||
//sell
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_part_in isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], _distance];
|
||||
_objects = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
|
||||
//diag_log format["DEBUG vehicle sell objects: %1", _objects];
|
||||
|
||||
|
||||
@@ -24,12 +24,7 @@ _bos = 0;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
|
||||
if (_part_in isKindOf "Air") then {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
};
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
@@ -80,11 +75,7 @@ if (_qty >= _qty_in) then {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
if (_part_in isKindOf "AIR") then {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_air];
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance_vehicle];
|
||||
};
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], Z_VehicleDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ TraderCatList = [];
|
||||
TraderItemList = [];
|
||||
|
||||
TraderDialogLoadItemList = {
|
||||
private ["_index","_trader_id","_activatingPlayer","_distance","_objclass","_item_list"];
|
||||
private ["_index","_trader_id","_activatingPlayer","_objclass","_item_list"];
|
||||
TraderItemList = [];
|
||||
_index = _this select 0;
|
||||
|
||||
@@ -128,14 +128,7 @@ TraderDialogLoadItemList = {
|
||||
};
|
||||
} else {
|
||||
if (isClass(configFile >> "CfgVehicles" >> _name)) then {
|
||||
_distance = dayz_sellDistance_vehicle;
|
||||
if (_name isKindOf "Air") then {
|
||||
_distance = dayz_sellDistance_air;
|
||||
};
|
||||
if (_name isKindOf "Ship") then {
|
||||
_distance = dayz_sellDistance_boat;
|
||||
};
|
||||
_count = {(typeOf _x) == _name} count (nearestObjects [(getPosATL player), [_name], _distance]);
|
||||
_count = {(typeOf _x) == _name} count (nearestObjects [(getPosATL player), [_name], Z_VehicleDistance]);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -45,9 +45,6 @@ DZE_groupManagement = false; //Enable or disable group management. Enabled by de
|
||||
DZE_salvageLocked = true; //Enable or disable salvaging of locked vehicles, useful for stopping griefing on locked vehicles.
|
||||
|
||||
// Trader Menu
|
||||
dayz_sellDistance_vehicle = 10; // Max distance players can sell land vehicles from at traders
|
||||
dayz_sellDistance_boat = 30; // Max distance players can sell boats from at traders
|
||||
dayz_sellDistance_air = 40; // Max distance players can sell air vehicles from at traders
|
||||
DZE_ConfigTrader = true; // Use config files for traders instead of database. Loads faster and uses less network traffic. False enables database traders with legacy trader menu.
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user