mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-04-18 10:16:39 +03:00
Advanced trading tidying, spelling fixes, private fixes and string fixes (#1716)
* Advanced trading tidying, spelling fixes, private fixes and string fixes. Fixes snap building issue with metal floors Fixed spelling mistakes in various scripts Fixed formatting uglyness in various scripts Fixed invalid private lines in various scripts Changed Advanced trading so buying worked more like selling, You can't select backpack if you don't have a pack nor can you select a vehicle if you don't have a vehicle. Removed some redundant strings from Advanced trading and changed a few of the strings to be more englishy Removed the ability to buy a backpack into your backpack (You cant do this anyway) Fixed a bug where if you had nothing in your backpack it would break the checkArrayInConfig script so the titlebar would not refresh correctly Removed slot counts on no backpack and no vehicle (No need for it, just clutter) Moved backpack/vehicle checking to z_at_getContainer.sqf * Last part of tidyness fixes Last part of tidyness fixes * Actual backpack fix Lets actually fix the buying backpack into backpack or backpack when you already have one. * Missing from commit Missing from commit
This commit is contained in:
@@ -304,10 +304,10 @@ class SnapBuilding {
|
|||||||
class MetalFloor_DZ: FloorsWallsStairs{
|
class MetalFloor_DZ: FloorsWallsStairs{
|
||||||
points[] = {
|
points[] = {
|
||||||
{0,0,0,"Pivot"},
|
{0,0,0,"Pivot"},
|
||||||
{0, -2.64, 0.025,"Back"},
|
{0, -2.64, 0.166,"Back"},
|
||||||
{0, 2.64, 0.025,"Front"},
|
{0, 2.64, 0.166,"Front"},
|
||||||
{-2.64, 0, 0.025,"Left"},
|
{-2.64, 0, 0.166,"Left"},
|
||||||
{2.64, 0, 0.025,"Right"}
|
{2.64, 0, 0.166,"Right"}
|
||||||
};
|
};
|
||||||
radius = 12;
|
radius = 12;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
// Remove preview build by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
// Remove preview build by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/)
|
||||||
|
private ["_distance","_plotPole","_findNearestPoles","_validMarkers","_isNearPlot","_poleInv"]
|
||||||
private ["_location","_object","_objects","_i","_dir","_nearPlotPole","_validMarkers","_findNearestPoles","_poleinv","_IsNearPlot","_plotpole"];
|
|
||||||
|
|
||||||
_distance = (DZE_PlotPole select 0) + 5;
|
_distance = (DZE_PlotPole select 0) + 5;
|
||||||
|
|
||||||
// check for near plot
|
// check for near plot
|
||||||
_plotpole = nearestobject [(vehicle player),"Plastic_Pole_EP1_DZ"];
|
_plotPole = nearestobject [(vehicle player),"Plastic_Pole_EP1_DZ"];
|
||||||
_findNearestPoles = (position _plotpole) nearEntities ["Land_coneLight", _distance];
|
_findNearestPoles = (position _plotpole) nearEntities ["Land_coneLight", _distance];
|
||||||
_validMarkers = [];
|
_validMarkers = [];
|
||||||
_isnearplot = 0;
|
_isNearPlot = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
_poleinv = _x getVariable ["inventory",[]];
|
_poleInv = _x getVariable ["inventory",[]];
|
||||||
|
|
||||||
if (_poleinv select 0 == "PPMarker") then {
|
if (_poleInv select 0 == "PPMarker") then {
|
||||||
_validMarkers set [count _validMarkers,_x];
|
_validMarkers set [count _validMarkers,_x];
|
||||||
};
|
};
|
||||||
} count _findNearestPoles;
|
} count _findNearestPoles;
|
||||||
@@ -27,4 +26,3 @@ if (_IsNearPlot > 0) then{
|
|||||||
deleteVehicle _x;
|
deleteVehicle _x;
|
||||||
} count _validMarkers;
|
} count _validMarkers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
// Build preview adopted from Axe Cop (@vos) Base Destruction Script
|
// Build preview adopted from Axe Cop (@vos) Base Destruction Script
|
||||||
// Amended by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/) to allow plot radius removal.
|
// Amended by RimBlock (http://epochmod.com/forum/index.php?/user/12612-rimblock/) to allow plot radius removal.
|
||||||
|
private ["_location","_object","_i","_nearPlotPole","_lightArray","_BD_radius","_BD_center","_color"];
|
||||||
private ["_location","_object","_i","_dir","_nearPlotPole","_light","_lightlocationtemp","_lightlocation","_lightarray"];
|
|
||||||
|
|
||||||
// global vars
|
// global vars
|
||||||
_nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ"];
|
_nearPlotPole = nearestObject [player, "Plastic_Pole_EP1_DZ"];
|
||||||
_lightarray = [];
|
_lightArray = [];
|
||||||
|
|
||||||
//"privatized" center variable
|
//"privatized" center variable
|
||||||
_BD_radius = DZE_PlotPole select 0;
|
_BD_radius = DZE_PlotPole select 0;
|
||||||
@@ -21,6 +20,3 @@ for "_i" from 0 to 360 step (450 / _BD_radius) do {
|
|||||||
_object setVariable ["Inventory", ["PPMarker"],true];
|
_object setVariable ["Inventory", ["PPMarker"],true];
|
||||||
_object enableSimulation false;
|
_object enableSimulation false;
|
||||||
_object setpos _location;
|
_object setpos _location;
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ if (_isowner select 0) then {
|
|||||||
{
|
{
|
||||||
_object = _x;
|
_object = _x;
|
||||||
_classname = typeOf _object;
|
_classname = typeOf _object;
|
||||||
if (_classname in DZE_plotTakeOwnershipItems)then {
|
if (_classname in DZE_plotTakeOwnershipItems) then {
|
||||||
|
|
||||||
_isowner = [player, _object] call FNC_check_access;
|
_isowner = [player, _object] call FNC_check_access;
|
||||||
diag_log text "Plot Take Ownership: Object in DZE_plotTakeOwnershipItems";
|
diag_log text "Plot Take Ownership: Object in DZE_plotTakeOwnershipItems";
|
||||||
@@ -44,9 +44,9 @@ if (_isowner select 0) then {
|
|||||||
_object setvariable["ObjectID", "0"];
|
_object setvariable["ObjectID", "0"];
|
||||||
|
|
||||||
if (_classname in DZE_DoorsLocked) then {
|
if (_classname in DZE_DoorsLocked) then {
|
||||||
_charID = _object getVariable ["characterID",dayz_characterID];
|
_charID = _object getVariable ["characterID",dayz_characterID];
|
||||||
}else{
|
} else {
|
||||||
_charID = dayz_characterID;
|
_charID = dayz_characterID;
|
||||||
};
|
};
|
||||||
|
|
||||||
_position = getPosATL _object;
|
_position = getPosATL _object;
|
||||||
@@ -56,25 +56,25 @@ if (_isowner select 0) then {
|
|||||||
_invW = getWeaponCargo _object;
|
_invW = getWeaponCargo _object;
|
||||||
{
|
{
|
||||||
if ((count _x) != 0) then {_itemsExist = true;};
|
if ((count _x) != 0) then {_itemsExist = true;};
|
||||||
}foreach _invW;
|
} foreach _invW;
|
||||||
|
|
||||||
_invM = getMagazineCargo _object;
|
_invM = getMagazineCargo _object;
|
||||||
if !(_itemsExist) then{
|
if !(_itemsExist) then {
|
||||||
{
|
{
|
||||||
if ((count _x) != 0) then {_itemsExist = true;};
|
if ((count _x) != 0) then {_itemsExist = true;};
|
||||||
}foreach _invM;
|
}foreach _invM;
|
||||||
};
|
};
|
||||||
|
|
||||||
_invB = getBackpackCargo _object;
|
_invB = getBackpackCargo _object;
|
||||||
if !(_itemsExist) then{
|
if !(_itemsExist) then {
|
||||||
{
|
{
|
||||||
if ((count _x) != 0) then {_itemsExist = true;};
|
if ((count _x) != 0) then {_itemsExist = true;};
|
||||||
}foreach _invB;
|
} foreach _invB;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_itemsExist) then{
|
if (_itemsExist) then {
|
||||||
_inventory = format["[%1,%2,%3]", _invW, _invM, _invB];
|
_inventory = format["[%1,%2,%3]", _invW, _invM, _invB];
|
||||||
}else{
|
} else {
|
||||||
_inventory = "[]";
|
_inventory = "[]";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -92,5 +92,4 @@ if (_isowner select 0) then {
|
|||||||
};
|
};
|
||||||
} count _findNearestObjects;
|
} count _findNearestObjects;
|
||||||
format[localize "STR_EPOCH_APLOTFORLIFE_TAKE_OWNERSHIP",_changecount] call dayz_rollingMessages;
|
format[localize "STR_EPOCH_APLOTFORLIFE_TAKE_OWNERSHIP",_changecount] call dayz_rollingMessages;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_player","_amount","_wealth","_newwealth", "_result"];
|
private ["_player","_amount","_wealth","_newwealth", "_result"];
|
||||||
|
|
||||||
_player = _this select 0;
|
_player = _this select 0;
|
||||||
_amount = _this select 1;
|
_amount = _this select 1;
|
||||||
_result = false;
|
_result = false;
|
||||||
@@ -10,4 +11,5 @@ if (_player == player) then {call player_forceSave;};
|
|||||||
_player setVariable ["moneychanged",1,true];
|
_player setVariable ["moneychanged",1,true];
|
||||||
_newwealth = _player getVariable[Z_MoneyVariable,0];
|
_newwealth = _player getVariable[Z_MoneyVariable,0];
|
||||||
if (_newwealth >= _wealth) then { _result = true; };
|
if (_newwealth >= _wealth) then { _result = true; };
|
||||||
|
|
||||||
_result
|
_result
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
private ["_player","_amount","_wealth","_newwealth", "_result"];
|
private ["_player","_amount","_wealth","_newwealth", "_result"];
|
||||||
|
|
||||||
_player = _this select 0;
|
_player = _this select 0;
|
||||||
_amount = _this select 1;
|
_amount = _this select 1;
|
||||||
_result = false;
|
_result = false;
|
||||||
_wealth = _player getVariable[Z_MoneyVariable,0];
|
_wealth = _player getVariable[Z_MoneyVariable,0];
|
||||||
if(_amount > 0)then{
|
if (_amount > 0) then {
|
||||||
if (_wealth < _amount) then {
|
if (_wealth < _amount) then {
|
||||||
_result = false;
|
_result = false;
|
||||||
|
} else {
|
||||||
|
_newwealth = _wealth - _amount;
|
||||||
|
_player setVariable[Z_MoneyVariable,_newwealth, true];
|
||||||
|
_player setVariable ["moneychanged",1,true];
|
||||||
|
_result = true;
|
||||||
|
// can't use (magazines _player), server_playerSync expects nested array with ammo counts from player_countMagazines
|
||||||
|
// also fourth parameter in PVDZ_plr_Save is now used for achievements
|
||||||
|
if (_player == player) then { call player_forceSave; };
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
_newwealth = _wealth - _amount;
|
_result = true;
|
||||||
_player setVariable[Z_MoneyVariable,_newwealth, true];
|
|
||||||
_player setVariable ["moneychanged",1,true];
|
|
||||||
_result = true;
|
|
||||||
// can't use (magazines _player), server_playerSync expects nested array with ammo counts from player_countMagazines
|
|
||||||
// also fourth parameter in PVDZ_plr_Save is now used for achievements
|
|
||||||
if (_player == player) then {call player_forceSave;};
|
|
||||||
};
|
|
||||||
}else{
|
|
||||||
_result = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_result
|
_result
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
private ["_selection","_return","_toBuyWeaps","_toBuyMags","_toBuyBags","_toolsToBuy","_sidearmToBuy","_primaryToBuy","_currentPrimarys"
|
private ["_selection","_return","_toBuyWeaps","_toBuyMags","_toBuyBags","_toolsToBuy","_sidearmToBuy","_primaryToBuy","_currentPrimarys"
|
||||||
,"_currentSec","_currentPrim","_currentTool","_p","_b","_check0","_check1","_check2","_check3","_check4","_mags","_weaps","_bags"
|
,"_currentSec","_currentPrim","_currentTool","_p","_b","_check0","_check1","_check2","_check3","_check4","_mags","_weaps","_bags"
|
||||||
,"_normalBags","_normalMags","_normalWeaps","_allowedMags","_allowedPrimary","_allowedTools","_allowedSidearm","_allowedWeapons","_allowedBackpacks"
|
,"_normalBags","_normalMags","_normalWeaps","_allowedMags","_allowedPrimary","_allowedTools","_allowedSidearm","_allowedWeapons","_allowedBackpacks"
|
||||||
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3",
|
,"_totalSpace","_totalNewSpace","_counter","_parentClasses","_alreadyInBackpack","_kinds","_kinds2","_kinds3","_amounts","_amounts2","_amounts3",
|
||||||
"_actualMags","_toolClasses","_duplicate","_quantity","_tool","_totalBagSlots"
|
"_actualMags","_toolClasses","_duplicate","_quantity","_tool","_totalBagSlots"
|
||||||
];
|
];
|
||||||
_selection = Z_SellingFrom;
|
_selection = Z_SellingFrom;
|
||||||
@@ -20,14 +20,14 @@ if (_vehiclesToBuy > 0) then {
|
|||||||
_toolsToBuy = _toolsToBuy + _vehiclesToBuy;
|
_toolsToBuy = _toolsToBuy + _vehiclesToBuy;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_selection == 2) then{ //gear
|
if (_selection == 2) then { //gear
|
||||||
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
||||||
_allowedMags = 20 - _actualMags;
|
_allowedMags = 20 - _actualMags;
|
||||||
|
|
||||||
_currentPrimarys = 0;
|
_currentPrimarys = 0;
|
||||||
|
|
||||||
_p = primaryWeapon player;
|
_p = primaryWeapon player;
|
||||||
if ( !isNil '_p' && _p != "" ) then {
|
if (!isNil '_p' && _p != "") then {
|
||||||
_currentPrimarys = 1;
|
_currentPrimarys = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ if(_selection == 2) then{ //gear
|
|||||||
_currentBackpacks = 0;
|
_currentBackpacks = 0;
|
||||||
|
|
||||||
_b = unitBackpack player;
|
_b = unitBackpack player;
|
||||||
if ( !isNull _b ) then {
|
if (!isNull _b) then {
|
||||||
_currentBackpacks = 1;
|
_currentBackpacks = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -53,12 +53,12 @@ if(_selection == 2) then{ //gear
|
|||||||
_allowedTools = 14; // 12 toolbelt + 1 Binocular + 1 NVG
|
_allowedTools = 14; // 12 toolbelt + 1 Binocular + 1 NVG
|
||||||
_duplicate = false;
|
_duplicate = false;
|
||||||
{
|
{
|
||||||
_parentClasses = [(configFile >> "CfgWeapons" >> _x ),true] call BIS_fnc_returnParents;
|
_parentClasses = [(configFile >> "CfgWeapons" >> _x),true] call BIS_fnc_returnParents;
|
||||||
if( 'ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
if ('ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
||||||
_allowedTools = _allowedTools - 1;
|
_allowedTools = _allowedTools - 1;
|
||||||
if (_x in _toolClasses) then {_duplicate = true;}; // Forbid purchasing duplicate tools into gear
|
if (_x in _toolClasses) then {_duplicate = true;}; // Forbid purchasing duplicate tools into gear
|
||||||
}
|
}
|
||||||
}count (weapons player);
|
} count (weapons player);
|
||||||
|
|
||||||
{
|
{
|
||||||
_tool = _x;
|
_tool = _x;
|
||||||
@@ -70,32 +70,28 @@ if(_selection == 2) then{ //gear
|
|||||||
_check2 = false;
|
_check2 = false;
|
||||||
_check3 = false;
|
_check3 = false;
|
||||||
|
|
||||||
if( _allowedPrimary >= _primaryToBuy && _allowedSidearm >= _sidearmToBuy && _allowedTools >= _toolsToBuy && !_duplicate)then{
|
if (_allowedPrimary >= _primaryToBuy && _allowedSidearm >= _sidearmToBuy && _allowedTools >= _toolsToBuy && !_duplicate) then {
|
||||||
_check1 = true;
|
_check1 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_GEAR_FULL", _allowedPrimary, _allowedSidearm , _allowedTools];
|
systemChat format[localize "STR_EPOCH_TRADE_GEAR_FULL", _allowedPrimary, _allowedSidearm , _allowedTools];
|
||||||
};
|
};
|
||||||
if( _allowedMags >= _toBuyMags)then{
|
if (_allowedMags >= _toBuyMags) then {
|
||||||
_check2 = true;
|
_check2 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_MAGS_FULL",_allowedMags];
|
systemChat format[localize "STR_EPOCH_TRADE_MAGS_FULL",_allowedMags];
|
||||||
};
|
};
|
||||||
if( _allowedBackpacks >= _toBuyBags)then{
|
if (_allowedBackpacks >= _toBuyBags) then {
|
||||||
_check3 = true;
|
_check3 = true;
|
||||||
}else{
|
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_BAG_FULL",_allowedBackpacks];
|
|
||||||
};
|
|
||||||
|
|
||||||
if(_check1 && _check2 && _check3)then{
|
|
||||||
_return = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_check1 && _check2 && _check3) then { _return = true; };
|
||||||
};
|
};
|
||||||
if(_selection == 1) then{ //vehicle
|
|
||||||
|
if (_selection == 1) then { //vehicle
|
||||||
_allowedMags = 0;
|
_allowedMags = 0;
|
||||||
_allowedWeapons = 0;
|
_allowedWeapons = 0;
|
||||||
_allowedBackpacks = 0;
|
_allowedBackpacks = 0;
|
||||||
if ( !isNull Z_vehicle) then {
|
if (!isNull Z_vehicle) then {
|
||||||
|
|
||||||
_mags = getMagazineCargo Z_vehicle;
|
_mags = getMagazineCargo Z_vehicle;
|
||||||
_weaps = getWeaponCargo Z_vehicle;
|
_weaps = getWeaponCargo Z_vehicle;
|
||||||
@@ -106,35 +102,34 @@ if(_selection == 1) then{ //vehicle
|
|||||||
_normalBags = [];
|
_normalBags = [];
|
||||||
|
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts select _forEachIndex)}do{
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_normalMags set [count(_normalMags),_x];
|
_normalMags set [count(_normalMags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds;
|
} forEach _kinds;
|
||||||
|
|
||||||
_kinds2 = _weaps select 0;
|
_kinds2 = _weaps select 0;
|
||||||
_ammmounts2 = _weaps select 1;
|
_amounts2 = _weaps select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts2 select _forEachIndex)}do{
|
while {_counter < (_amounts2 select _forEachIndex)} do {
|
||||||
_normalWeaps set [count(_normalWeaps),_x];
|
_normalWeaps set [count(_normalWeaps),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds2;
|
} forEach _kinds2;
|
||||||
|
|
||||||
_kinds3 = _bags select 0;
|
_kinds3 = _bags select 0;
|
||||||
_ammmounts3 = _bags select 1;
|
_amounts3 = _bags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts3 select _forEachIndex)}do{
|
while{_counter < (_amounts3 select _forEachIndex)} do {
|
||||||
_normalBags set [count(_normalBags),_x];
|
_normalBags set [count(_normalBags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds3;
|
} forEach _kinds3;
|
||||||
|
|
||||||
|
|
||||||
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxWeapons') - count(_normalWeaps);
|
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxWeapons') - count(_normalWeaps);
|
||||||
_allowedMags = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxMagazines') - count(_normalMags);
|
_allowedMags = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxMagazines') - count(_normalMags);
|
||||||
@@ -145,27 +140,26 @@ if(_selection == 1) then{ //vehicle
|
|||||||
_check2 = false;
|
_check2 = false;
|
||||||
_check3 = false;
|
_check3 = false;
|
||||||
|
|
||||||
if( _allowedWeapons >= ( _toBuyWeaps + _toolsToBuy ) )then{
|
if (_allowedWeapons >= (_toBuyWeaps + _toolsToBuy)) then {
|
||||||
_check1 = true;
|
_check1 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_WEPS", _allowedWeapons];
|
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_WEPS", _allowedWeapons];
|
||||||
};
|
};
|
||||||
if( _allowedMags >= _toBuyMags)then{
|
if (_allowedMags >= _toBuyMags) then {
|
||||||
_check2 = true;
|
_check2 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_MAGS", _allowedMags];
|
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_MAGS", _allowedMags];
|
||||||
};
|
};
|
||||||
if( _allowedBackpacks >= _toBuyBags)then{
|
if (_allowedBackpacks >= _toBuyBags) then {
|
||||||
_check3 = true;
|
_check3 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_BAGS", _allowedBackpacks];
|
systemChat format[localize "STR_EPOCH_TRADE_VEHICLE_BAGS", _allowedBackpacks];
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_check1 && _check2 && _check3)then{
|
if (_check1 && _check2 && _check3) then { _return = true; };
|
||||||
_return = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
if(_selection == 0) then{ //backpack
|
|
||||||
|
if (_selection == 0) then { //backpack
|
||||||
_allowedWeapons = 0;
|
_allowedWeapons = 0;
|
||||||
_allowedMags = 0;
|
_allowedMags = 0;
|
||||||
_allowedBackpacks = 0;
|
_allowedBackpacks = 0;
|
||||||
@@ -185,41 +179,39 @@ if(_selection == 0) then{ //backpack
|
|||||||
_normalWeaps = [];
|
_normalWeaps = [];
|
||||||
|
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts select _forEachIndex)} do {
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_normalMags set [count(_normalMags), _x];
|
_normalMags set [count(_normalMags), _x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds;
|
} forEach _kinds;
|
||||||
|
|
||||||
_kinds2 = _weaps select 0;
|
_kinds2 = _weaps select 0;
|
||||||
_ammmounts2 = _weaps select 1;
|
_amounts2 = _weaps select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts2 select _forEachIndex)} do {
|
while {_counter < (_amounts2 select _forEachIndex)} do {
|
||||||
_normalWeaps set [count(_normalWeaps), _x];
|
_normalWeaps set [count(_normalWeaps), _x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds2;
|
} forEach _kinds2;
|
||||||
|
|
||||||
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'transportMaxWeapons') - count(_normalWeaps);
|
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'transportMaxWeapons') - count(_normalWeaps);
|
||||||
_totalBagSlots = getNumber (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'transportMaxMagazines');
|
_totalBagSlots = getNumber (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'transportMaxMagazines');
|
||||||
_allowedMags = _totalBagSlots - count(_normalMags);
|
_allowedMags = _totalBagSlots - count(_normalMags);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_currentPrim = 0;
|
_currentPrim = 0;
|
||||||
_currentSec = 0;
|
_currentSec = 0;
|
||||||
_currentTool = 0;
|
_currentTool = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
_parentClasses = [(configFile >> "CfgWeapons" >> _x ),true] call BIS_fnc_returnParents;
|
_parentClasses = [(configFile >> "CfgWeapons" >> _x),true] call BIS_fnc_returnParents;
|
||||||
if( 'ItemCore' in _parentClasses || 'Binocular' in _parentClasses ) then {
|
if ('ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
||||||
_currentTool = _currentTool + 1;
|
_currentTool = _currentTool + 1;
|
||||||
} else {
|
} else {
|
||||||
if( 'PistolCore' in _parentClasses )then {
|
if ('PistolCore' in _parentClasses) then {
|
||||||
_currentSec = _currentSec + 1;
|
_currentSec = _currentSec + 1;
|
||||||
} else {
|
} else {
|
||||||
_currentPrim = _currentPrim + 1;
|
_currentPrim = _currentPrim + 1;
|
||||||
@@ -227,15 +219,14 @@ if(_selection == 0) then{ //backpack
|
|||||||
};
|
};
|
||||||
} count _normalWeaps;
|
} count _normalWeaps;
|
||||||
|
|
||||||
|
|
||||||
_alreadyInBackpack = (10 * _currentPrim) + (5 * _currentSec) + _currentTool + count(_normalMags);
|
_alreadyInBackpack = (10 * _currentPrim) + (5 * _currentSec) + _currentTool + count(_normalMags);
|
||||||
|
|
||||||
_totalNewSpace = 10 * _primaryToBuy + 5 * _sidearmToBuy + _toolsToBuy + _toBuyMags;
|
_totalNewSpace = 10 * _primaryToBuy + 5 * _sidearmToBuy + _toolsToBuy + _toBuyMags;
|
||||||
|
|
||||||
_totalSpace = _alreadyInBackpack + _totalNewSpace;
|
_totalSpace = _alreadyInBackpack + _totalNewSpace;
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
systemChat localize "STR_EPOCH_TRADE_NEED_BAG";
|
systemChat localize "STR_EPOCH_TRADE_NO_BACKPACK";
|
||||||
};
|
};
|
||||||
|
|
||||||
_check1 = false;
|
_check1 = false;
|
||||||
@@ -243,31 +234,27 @@ if(_selection == 0) then{ //backpack
|
|||||||
_check3 = false;
|
_check3 = false;
|
||||||
_check4 = false;
|
_check4 = false;
|
||||||
|
|
||||||
if( _allowedWeapons >= _toBuyWeaps)then{
|
if (_allowedWeapons >= _toBuyWeaps) then {
|
||||||
_check1 = true;
|
_check1 = true;
|
||||||
} else {
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_BAG_WEPS", _allowedWeapons];
|
systemChat format[localize "STR_EPOCH_TRADE_BAG_WEPS", _allowedWeapons];
|
||||||
};
|
};
|
||||||
if( _allowedMags >= _toBuyMags)then{
|
if (_allowedMags >= _toBuyMags) then {
|
||||||
_check2 = true;
|
_check2 = true;
|
||||||
} else {
|
} else {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_BAG_MAGS", _allowedMags];
|
systemChat format[localize "STR_EPOCH_TRADE_BAG_MAGS", _allowedMags];
|
||||||
};
|
};
|
||||||
if( _allowedBackpacks >= _toBuyBags)then{
|
if (_allowedBackpacks >= _toBuyBags) then {
|
||||||
_check3 = true;
|
_check3 = true;
|
||||||
} else {
|
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_BAG_BAGS", _allowedBackpacks ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if( _totalSpace <= _totalBagSlots)then{
|
if (_totalSpace <= _totalBagSlots) then {
|
||||||
_check4 = true;
|
_check4 = true;
|
||||||
}else{
|
} else {
|
||||||
systemChat localize "STR_EPOCH_TRADE_BACKPACK_FULL";
|
systemChat localize "STR_EPOCH_TRADE_BACKPACK_FULL";
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_check0 && _check1 && _check2 && _check3 && _check4)then{
|
if (_check0 && _check1 && _check2 && _check3 && _check4) then { _return = true; };
|
||||||
_return = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_return;
|
_return;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
private ["_magazinesToBuy", "_weaponsToBuy", "_backpacksToBuy", "_toolsToBuy", "_sidearmToBuy", "_primaryToBuy", "_priceToBuy"
|
private ["_magazinesToBuy", "_weaponsToBuy", "_backpacksToBuy", "_toolsToBuy", "_sidearmToBuy", "_primaryToBuy", "_priceToBuy"
|
||||||
,"_enoughMoney", "_myMoney", "_canBuy", "_moneyInfo","_count","_success","_backpack","_toolClasses","_itemsToLog","_tCost","_bTotal"
|
,"_enoughMoney", "_myMoney", "_canBuy", "_moneyInfo","_count","_success","_backpack","_toolClasses","_itemsToLog","_tCost","_bTotal","_backpack"
|
||||||
];
|
];
|
||||||
|
|
||||||
if (count Z_BuyingArray < 1) exitWith { systemChat localize "STR_EPOCH_TRADE_BUY_NO_ITEMS"; };
|
if (count Z_BuyingArray < 1) exitWith { systemChat localize "STR_EPOCH_TRADE_BUY_NO_ITEMS"; };
|
||||||
@@ -11,21 +11,22 @@ _toolsToBuy = 0;
|
|||||||
_sidearmToBuy = 0;
|
_sidearmToBuy = 0;
|
||||||
_primaryToBuy = 0;
|
_primaryToBuy = 0;
|
||||||
_vehiclesToBuy = 0;
|
_vehiclesToBuy = 0;
|
||||||
|
|
||||||
_priceToBuy = 0;
|
_priceToBuy = 0;
|
||||||
|
|
||||||
|
_backpack = unitBackpack player;
|
||||||
_toolClasses = [];
|
_toolClasses = [];
|
||||||
_itemsToLog = [[],[],[],"buy"];
|
_itemsToLog = [[],[],[],"buy"];
|
||||||
|
|
||||||
if (Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
{
|
{
|
||||||
if( _x select 1 == "trade_weapons")then{
|
if (_x select 1 == "trade_weapons") then {
|
||||||
_parentClasses = [(configFile >> "CfgWeapons" >> (_x select 0)),true] call BIS_fnc_returnParents;
|
_parentClasses = [(configFile >> "CfgWeapons" >> (_x select 0)),true] call BIS_fnc_returnParents;
|
||||||
if( 'ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
if ('ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
||||||
_toolsToBuy = _toolsToBuy + (_x select 9);
|
_toolsToBuy = _toolsToBuy + (_x select 9);
|
||||||
_toolClasses set [count _toolClasses,(_x select 0)];
|
_toolClasses set [count _toolClasses,(_x select 0)];
|
||||||
} else {
|
} else {
|
||||||
_weaponsToBuy = _weaponsToBuy + (_x select 9);
|
_weaponsToBuy = _weaponsToBuy + (_x select 9);
|
||||||
if('PistolCore' in _parentClasses)then {
|
if ('PistolCore' in _parentClasses) then {
|
||||||
_sidearmToBuy = _sidearmToBuy + (_x select 9);
|
_sidearmToBuy = _sidearmToBuy + (_x select 9);
|
||||||
} else {
|
} else {
|
||||||
_primaryToBuy = _primaryToBuy + (_x select 9); // _ammount
|
_primaryToBuy = _primaryToBuy + (_x select 9); // _ammount
|
||||||
@@ -33,15 +34,15 @@ if (Z_SingleCurrency) then {
|
|||||||
};
|
};
|
||||||
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2));
|
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2));
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
_magazinesToBuy = _magazinesToBuy + (_x select 9) ;
|
_magazinesToBuy = _magazinesToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2));
|
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2));
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_backpacks")then{
|
if (_x select 1 == "trade_backpacks") then {
|
||||||
_backpacksToBuy = _backpacksToBuy + (_x select 9) ;
|
_backpacksToBuy = _backpacksToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount
|
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount
|
||||||
};
|
};
|
||||||
if((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_vehiclesToBuy = _vehiclesToBuy + (_x select 9) ;
|
_vehiclesToBuy = _vehiclesToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount
|
_priceToBuy = _priceToBuy + ((_x select 9)*(_x select 2)); // _price * _amount
|
||||||
};
|
};
|
||||||
@@ -51,14 +52,14 @@ if (Z_SingleCurrency) then {
|
|||||||
} count Z_BuyingArray;
|
} count Z_BuyingArray;
|
||||||
} else {
|
} else {
|
||||||
{
|
{
|
||||||
if( _x select 1 == "trade_weapons")then{
|
if (_x select 1 == "trade_weapons") then {
|
||||||
_parentClasses = [(configFile >> "CfgWeapons" >> (_x select 0)),true] call BIS_fnc_returnParents;
|
_parentClasses = [(configFile >> "CfgWeapons" >> (_x select 0)),true] call BIS_fnc_returnParents;
|
||||||
if( 'ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
if ('ItemCore' in _parentClasses || 'Binocular' in _parentClasses) then {
|
||||||
_toolsToBuy = _toolsToBuy + (_x select 9);
|
_toolsToBuy = _toolsToBuy + (_x select 9);
|
||||||
_toolClasses set [count _toolClasses,(_x select 0)];
|
_toolClasses set [count _toolClasses,(_x select 0)];
|
||||||
} else {
|
} else {
|
||||||
_weaponsToBuy = _weaponsToBuy + (_x select 9);
|
_weaponsToBuy = _weaponsToBuy + (_x select 9);
|
||||||
if('PistolCore' in _parentClasses)then {
|
if ('PistolCore' in _parentClasses) then {
|
||||||
_sidearmToBuy = _sidearmToBuy + (_x select 9);
|
_sidearmToBuy = _sidearmToBuy + (_x select 9);
|
||||||
} else {
|
} else {
|
||||||
_primaryToBuy = _primaryToBuy + (_x select 9);
|
_primaryToBuy = _primaryToBuy + (_x select 9);
|
||||||
@@ -66,15 +67,15 @@ if (Z_SingleCurrency) then {
|
|||||||
};
|
};
|
||||||
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); // _worth * _price * _amount
|
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9)); // _worth * _price * _amount
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
_magazinesToBuy = _magazinesToBuy + (_x select 9) ;
|
_magazinesToBuy = _magazinesToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 11) *(_x select 2)*(_x select 9));
|
_priceToBuy = _priceToBuy + ((_x select 11) *(_x select 2)*(_x select 9));
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_backpacks")then{
|
if (_x select 1 == "trade_backpacks") then {
|
||||||
_backpacksToBuy = _backpacksToBuy + (_x select 9) ;
|
_backpacksToBuy = _backpacksToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9));
|
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9));
|
||||||
};
|
};
|
||||||
if((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_vehiclesToBuy = _vehiclesToBuy + (_x select 9) ;
|
_vehiclesToBuy = _vehiclesToBuy + (_x select 9) ;
|
||||||
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9));
|
_priceToBuy = _priceToBuy + ((_x select 11)*(_x select 2)*(_x select 9));
|
||||||
};
|
};
|
||||||
@@ -103,8 +104,11 @@ if (Z_SingleCurrency) then {
|
|||||||
_enoughMoney = _moneyInfo select 0;
|
_enoughMoney = _moneyInfo select 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_enoughMoney) then {
|
if (Z_SellingFrom == 0 && _backpacksToBuy >= 1) exitWith { systemChat localize "STR_EPOCH_TRADE_BAG_BAGS"; }; //backpack
|
||||||
if(_canBuy) then {
|
if (Z_SellingFrom == 2 && !isNull _backpack) exitWith { systemChat localize "STR_EPOCH_TRADE_HAVE_BACKPACK"; }; //gear
|
||||||
|
|
||||||
|
if (_enoughMoney) then {
|
||||||
|
if (_canBuy) then {
|
||||||
_bTotal = 0;
|
_bTotal = 0;
|
||||||
_buyVehicle = {
|
_buyVehicle = {
|
||||||
private "_location";
|
private "_location";
|
||||||
@@ -125,7 +129,7 @@ if(_enoughMoney) then {
|
|||||||
_dir = round(random 360);
|
_dir = round(random 360);
|
||||||
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
|
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
|
||||||
|
|
||||||
if(count _helipad > 0) then {
|
if (count _helipad > 0) then {
|
||||||
_location = (getPosATL (_helipad select 0));
|
_location = (getPosATL (_helipad select 0));
|
||||||
} else {
|
} else {
|
||||||
_location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
|
_location = [([player] call FNC_GetPos),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
|
||||||
@@ -146,16 +150,16 @@ if(_enoughMoney) then {
|
|||||||
|
|
||||||
closeDialog 2;
|
closeDialog 2;
|
||||||
|
|
||||||
if(Z_SellingFrom == 0) then { //backpack
|
if (Z_SellingFrom == 0) then { //backpack
|
||||||
_backpack = unitBackpack player;
|
_backpack = unitBackpack player;
|
||||||
{
|
{
|
||||||
if( _x select 1 == "trade_weapons")then{
|
if (_x select 1 == "trade_weapons") then {
|
||||||
_backpack addWeaponCargoGlobal [_x select 0, _x select 9];
|
_backpack addWeaponCargoGlobal [_x select 0, _x select 9];
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
_backpack addMagazineCargoGlobal [_x select 0, _x select 9];
|
_backpack addMagazineCargoGlobal [_x select 0, _x select 9];
|
||||||
};
|
};
|
||||||
if((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
||||||
if (_item2Add != "0") then {
|
if (_item2Add != "0") then {
|
||||||
_backpack addWeaponCargoGlobal [_item2Add, 1];
|
_backpack addWeaponCargoGlobal [_item2Add, 1];
|
||||||
@@ -166,18 +170,18 @@ if(_enoughMoney) then {
|
|||||||
systemChat format[localize "STR_EPOCH_TRADE_BUY_IN_BACKPACK",_bTotal];
|
systemChat format[localize "STR_EPOCH_TRADE_BUY_IN_BACKPACK",_bTotal];
|
||||||
};
|
};
|
||||||
|
|
||||||
if(Z_SellingFrom == 1) then { //vehicle
|
if (Z_SellingFrom == 1) then { //vehicle
|
||||||
{
|
{
|
||||||
if( _x select 1 == "trade_weapons")then{
|
if (_x select 1 == "trade_weapons") then {
|
||||||
Z_vehicle addWeaponCargoGlobal [_x select 0, _x select 9];
|
Z_vehicle addWeaponCargoGlobal [_x select 0, _x select 9];
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
Z_vehicle addMagazineCargoGlobal [_x select 0, _x select 9];
|
Z_vehicle addMagazineCargoGlobal [_x select 0, _x select 9];
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_backpacks")then{
|
if (_x select 1 == "trade_backpacks") then {
|
||||||
Z_vehicle addBackpackCargoGlobal [_x select 0, _x select 9];
|
Z_vehicle addBackpackCargoGlobal [_x select 0, _x select 9];
|
||||||
};
|
};
|
||||||
if((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
||||||
if (_item2Add != "0") then {
|
if (_item2Add != "0") then {
|
||||||
Z_vehicle addWeaponCargoGlobal [_item2Add, 1];
|
Z_vehicle addWeaponCargoGlobal [_item2Add, 1];
|
||||||
@@ -188,26 +192,26 @@ if(_enoughMoney) then {
|
|||||||
systemChat format[localize "STR_EPOCH_TRADE_BUY_IN_VEHICLE",_bTotal,typeOf Z_vehicle];
|
systemChat format[localize "STR_EPOCH_TRADE_BUY_IN_VEHICLE",_bTotal,typeOf Z_vehicle];
|
||||||
};
|
};
|
||||||
|
|
||||||
if(Z_SellingFrom == 2) then { //gear
|
if (Z_SellingFrom == 2) then { //gear
|
||||||
{
|
{
|
||||||
if( _x select 1 == "trade_weapons") then {
|
if (_x select 1 == "trade_weapons") then {
|
||||||
_count = 0;
|
_count = 0;
|
||||||
while{ _count < (_x select 9)}do{
|
while { _count < (_x select 9)} do {
|
||||||
player addWeapon (_x select 0);
|
player addWeapon (_x select 0);
|
||||||
_count = _count + 1;
|
_count = _count + 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_items" ) then {
|
if (_x select 1 == "trade_items") then {
|
||||||
_count = 0;
|
_count = 0;
|
||||||
while{ _count < (_x select 9)} do {
|
while { _count < (_x select 9)} do {
|
||||||
player addMagazine (_x select 0);
|
player addMagazine (_x select 0);
|
||||||
_count = _count + 1;
|
_count = _count + 1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if( _x select 1 == "trade_backpacks")then{
|
if (_x select 1 == "trade_backpacks") then {
|
||||||
player addBackpack (_x select 0);
|
player addBackpack (_x select 0);
|
||||||
};
|
};
|
||||||
if((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if ((_x select 1) in ["trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
_item2Add = [(_x select 0), (_x select 1)] call _buyVehicle;
|
||||||
if (_item2Add != "0") then {
|
if (_item2Add != "0") then {
|
||||||
player addWeapon _item2Add;
|
player addWeapon _item2Add;
|
||||||
@@ -239,7 +243,7 @@ if(_enoughMoney) then {
|
|||||||
systemChat localize "STR_EPOCH_TRADE_CONTAINER_FULL";
|
systemChat localize "STR_EPOCH_TRADE_CONTAINER_FULL";
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if( Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_NEED_COINS",_priceToBuy,CurrencyName];
|
systemChat format[localize "STR_EPOCH_TRADE_NEED_COINS",_priceToBuy,CurrencyName];
|
||||||
} else {
|
} else {
|
||||||
systemChat localize "STR_EPOCH_TRADE_NEED_MONEY";
|
systemChat localize "STR_EPOCH_TRADE_NEED_MONEY";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore","_categoryNumber"];
|
private ["_arrayOfTraderCat","_counter","_cat","_cfgtraders","_y","_type","_buy","_sell","_pic","_text","_worth","_buyCurrency","_sellCurrency","_ignore","_categoryNumber"];
|
||||||
|
|
||||||
call Z_clearBuyList;
|
call Z_clearBuyList;
|
||||||
Z_BuyableArray = [];
|
Z_BuyableArray = [];
|
||||||
_arrayOfTraderCat = Z_traderData;
|
_arrayOfTraderCat = Z_traderData;
|
||||||
@@ -17,7 +18,7 @@ _counter = 0;
|
|||||||
_y = _cfgtraders select _i;
|
_y = _cfgtraders select _i;
|
||||||
if (isClass _y) then
|
if (isClass _y) then
|
||||||
{
|
{
|
||||||
_y = configName (_y );
|
_y = configName (_y);
|
||||||
|
|
||||||
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
||||||
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
||||||
@@ -32,20 +33,20 @@ _counter = 0;
|
|||||||
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
if (_y == "bloodBagONEG") then {_y = "ItemBloodbag";} else {_ignore = true;};
|
||||||
};
|
};
|
||||||
|
|
||||||
if(_type == "trade_items")then{
|
if (_type == "trade_items") then {
|
||||||
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
if(_type == "trade_weapons")then{
|
if (_type == "trade_weapons") then {
|
||||||
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
if(_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"])then{
|
if (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) then {
|
||||||
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
||||||
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!Z_SingleCurrency) then {
|
if (!Z_SingleCurrency) then {
|
||||||
_buyCurrency = _buy select 1;
|
_buyCurrency = _buy select 1;
|
||||||
_sellCurrency = _sell select 1,
|
_sellCurrency = _sell select 1,
|
||||||
_part = (configFile >> "CfgMagazines" >> _buyCurrency);
|
_part = (configFile >> "CfgMagazines" >> _buyCurrency);
|
||||||
@@ -53,7 +54,7 @@ _counter = 0;
|
|||||||
if (_worth == 0) then {
|
if (_worth == 0) then {
|
||||||
_worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency);
|
_worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency);
|
||||||
};
|
};
|
||||||
}else{
|
} else {
|
||||||
_buyCurrency = CurrencyName;
|
_buyCurrency = CurrencyName;
|
||||||
_sellCurrency = CurrencyName;
|
_sellCurrency = CurrencyName;
|
||||||
};
|
};
|
||||||
@@ -64,7 +65,7 @@ _counter = 0;
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}forEach _arrayOfTraderCat;
|
} forEach _arrayOfTraderCat;
|
||||||
|
|
||||||
Z_CategoryView = false;
|
Z_CategoryView = false;
|
||||||
Z_Selling = true; // flipped in ChangeBuySell
|
Z_Selling = true; // flipped in ChangeBuySell
|
||||||
|
|||||||
@@ -3,46 +3,46 @@
|
|||||||
*
|
*
|
||||||
* Calculate the total price for single currency.
|
* Calculate the total price for single currency.
|
||||||
**/
|
**/
|
||||||
private ["_sellPrice","_ctrltext","_bTotal"];
|
private ["_sellPrice","_ctrlText","_bTotal"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_bTotal = 0;
|
_bTotal = 0;
|
||||||
_sellPrice = 0;
|
_sellPrice = 0;
|
||||||
|
|
||||||
if(Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
_ctrltext = '';
|
_ctrlText = "";
|
||||||
if(Z_Selling)then{
|
if (Z_Selling) then {
|
||||||
{
|
{
|
||||||
_sellPrice = _sellPrice + (_x select 2);
|
_sellPrice = _sellPrice + (_x select 2);
|
||||||
}count Z_SellArray;
|
} count Z_SellArray;
|
||||||
_ctrltext = format["%1 %2", _sellPrice , CurrencyName];
|
_ctrlText = format["%1 %2", _sellPrice , CurrencyName];
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
|
||||||
} else {
|
} else {
|
||||||
{
|
{
|
||||||
_sellPrice = _sellPrice + ((_x select 2) * (_x select 9));
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 9));
|
||||||
_bTotal = _bTotal + (_x select 9);
|
_bTotal = _bTotal + (_x select 9);
|
||||||
}count Z_BuyingArray;
|
} count Z_BuyingArray;
|
||||||
_ctrltext = format["%1 %2", _sellPrice , CurrencyName];
|
_ctrlText = format["%1 %2", _sellPrice , CurrencyName];
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
|
||||||
};
|
};
|
||||||
ctrlSetText [Z_AT_PRICEDISPLAY, _ctrltext];
|
ctrlSetText [Z_AT_PRICEDISPLAY, _ctrlText];
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText '';
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText '';
|
||||||
} else {
|
} else {
|
||||||
if(Z_Selling)then {
|
if (Z_Selling) then {
|
||||||
_ctrltext = "";
|
_ctrlText = "";
|
||||||
{
|
{
|
||||||
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11));
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11));
|
||||||
}count Z_SellArray;
|
} count Z_SellArray;
|
||||||
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
_ctrlText = _sellPrice call Z_calcDefaultCurrency;
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_SELLING", count Z_SellArray];
|
||||||
} else {
|
} else {
|
||||||
{
|
{
|
||||||
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11) * (_x select 9));
|
_sellPrice = _sellPrice + ((_x select 2) * (_x select 11) * (_x select 9));
|
||||||
_bTotal = _bTotal + (_x select 9);
|
_bTotal = _bTotal + (_x select 9);
|
||||||
}count Z_BuyingArray;
|
} count Z_BuyingArray;
|
||||||
_ctrltext = _sellPrice call Z_calcDefaultCurrency;
|
_ctrlText = _sellPrice call Z_calcDefaultCurrency;
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_RIGHTLISTTITLE) ctrlSetText format ["%1 (%2 items)", localize "STR_EPOCH_TRADE_BUYING", _bTotal];
|
||||||
};
|
};
|
||||||
ctrlSetText [Z_AT_PRICEDISPLAY, ''];
|
ctrlSetText [Z_AT_PRICEDISPLAY, ''];
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText _ctrltext;
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_PRICEINFO) ctrlSetStructuredText parseText _ctrlText;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ private["_selection","_returnArray","_allowedMags","_allowedWeapons","_allowedBa
|
|||||||
|
|
||||||
_selection = _this select 0;
|
_selection = _this select 0;
|
||||||
_returnArray = [0,0,0];
|
_returnArray = [0,0,0];
|
||||||
if(_selection == 2) then{ //gear
|
if (_selection == 2) then { //gear
|
||||||
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
_actualMags = {!(_x in MeleeMagazines)} count (magazines player);
|
||||||
_allowedMags = 20 - _actualMags;
|
_allowedMags = 20 - _actualMags;
|
||||||
// 12 toolbelt + 1 Binoculars + 1 NVG + 1 Pistol + 1 Primary (onBack isn't counted in weapons player)
|
// 12 toolbelt + 1 Binoculars + 1 NVG + 1 Pistol + 1 Primary (onBack isn't counted in weapons player)
|
||||||
@@ -24,7 +24,7 @@ if(_selection == 2) then{ //gear
|
|||||||
|
|
||||||
_returnArray = [_allowedMags, _allowedWeapons, _allowedBackpacks];
|
_returnArray = [_allowedMags, _allowedWeapons, _allowedBackpacks];
|
||||||
};
|
};
|
||||||
if(_selection == 1) then{ //vehicle
|
if (_selection == 1) then { //vehicle
|
||||||
_allowedMags = 0;
|
_allowedMags = 0;
|
||||||
_allowedWeapons = 0;
|
_allowedWeapons = 0;
|
||||||
_allowedBackpacks = 0;
|
_allowedBackpacks = 0;
|
||||||
@@ -46,21 +46,21 @@ if(_selection == 1) then{ //vehicle
|
|||||||
|
|
||||||
{
|
{
|
||||||
_vehicleMagazines = _vehicleMagazines + _x;
|
_vehicleMagazines = _vehicleMagazines + _x;
|
||||||
}count ( _tempMagazinesArray select 1);
|
} count (_tempMagazinesArray select 1);
|
||||||
|
|
||||||
|
|
||||||
_tempWeaponsArray = getWeaponCargo Z_vehicle;
|
_tempWeaponsArray = getWeaponCargo Z_vehicle;
|
||||||
|
|
||||||
{
|
{
|
||||||
_vehicleWeapons = _vehicleWeapons + _x;
|
_vehicleWeapons = _vehicleWeapons + _x;
|
||||||
}count ( _tempWeaponsArray select 1);
|
} count (_tempWeaponsArray select 1);
|
||||||
|
|
||||||
|
|
||||||
_tempBackpackArray = getBackpackCargo Z_vehicle;
|
_tempBackpackArray = getBackpackCargo Z_vehicle;
|
||||||
|
|
||||||
{
|
{
|
||||||
_vehicleBackpacks = _vehicleBackpacks + _x;
|
_vehicleBackpacks = _vehicleBackpacks + _x;
|
||||||
}count ( _tempBackpackArray select 1);
|
} count (_tempBackpackArray select 1);
|
||||||
|
|
||||||
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxWeapons');
|
_allowedWeapons = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxWeapons');
|
||||||
_allowedMags = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxMagazines');
|
_allowedMags = getNumber (configFile >> 'CfgVehicles' >> (typeOf Z_vehicle) >> 'transportMaxMagazines');
|
||||||
@@ -68,7 +68,7 @@ if(_selection == 1) then{ //vehicle
|
|||||||
};
|
};
|
||||||
_returnArray = [_allowedMags - _vehicleMagazines, _allowedWeapons - _vehicleWeapons, _allowedBackpacks - _vehicleBackpacks];
|
_returnArray = [_allowedMags - _vehicleMagazines, _allowedWeapons - _vehicleWeapons, _allowedBackpacks - _vehicleBackpacks];
|
||||||
};
|
};
|
||||||
if(_selection == 0) then{ //backpack
|
if (_selection == 0) then { //backpack
|
||||||
_allowedBackpacks = 0;
|
_allowedBackpacks = 0;
|
||||||
_totalBagSlots = 0;
|
_totalBagSlots = 0;
|
||||||
_alreadyInBackpack = 0;
|
_alreadyInBackpack = 0;
|
||||||
@@ -113,7 +113,7 @@ if(_selection == 0) then{ //backpack
|
|||||||
_currentSec = 0;
|
_currentSec = 0;
|
||||||
_currentTool = 0;
|
_currentTool = 0;
|
||||||
{
|
{
|
||||||
_parentClasses = [(configFile >> "CfgWeapons" >> _x ),true] call BIS_fnc_returnParents;
|
_parentClasses = [(configFile >> "CfgWeapons" >> _x),true] call BIS_fnc_returnParents;
|
||||||
if ('ItemCore' in _parentClasses or 'Binocular' in _parentClasses) then {
|
if ('ItemCore' in _parentClasses or 'Binocular' in _parentClasses) then {
|
||||||
_currentTool = _currentTool + 1;
|
_currentTool = _currentTool + 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
private ['_worth', '_total_currency','_return','_part','_totalToPay','_inventoryMoney','_backpackMoney',"_kinds","_kinds2","_kinds3","_ammmounts","_ammmounts2","_ammmounts3"
|
private ['_worth', '_total_currency','_return','_part','_totalToPay','_inventoryMoney','_backpackMoney',"_kinds","_kinds2","_kinds3","_amounts","_amounts2","_amounts3"
|
||||||
,"_vehicleMoney"];
|
,"_vehicleMoney"];
|
||||||
|
|
||||||
_totalToPay = _this;
|
_totalToPay = _this;
|
||||||
@@ -24,20 +24,20 @@ _inventoryMoney = [];
|
|||||||
|
|
||||||
_return set [1, _inventoryMoney];
|
_return set [1, _inventoryMoney];
|
||||||
|
|
||||||
if( Z_AllowTakingMoneyFromBackpack ) then {
|
if (Z_AllowTakingMoneyFromBackpack) then {
|
||||||
_backpackPlayer = unitBackpack player;
|
_backpackPlayer = unitBackpack player;
|
||||||
if (!isNull _backpackPlayer) then {
|
if (!isNull _backpackPlayer) then {
|
||||||
_mags = getMagazineCargo _backpackPlayer;
|
_mags = getMagazineCargo _backpackPlayer;
|
||||||
_backpackMoney = [];
|
_backpackMoney = [];
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_part = (configFile >> "CfgMagazines" >> _x);
|
_part = (configFile >> "CfgMagazines" >> _x);
|
||||||
_worth = (_part >> "worth");
|
_worth = (_part >> "worth");
|
||||||
if isNumber (_worth) then {
|
if isNumber (_worth) then {
|
||||||
_total_currency = _total_currency + ( getNumber(_worth) * (_ammmounts select _forEachIndex));
|
_total_currency = _total_currency + (getNumber(_worth) * (_amounts select _forEachIndex));
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{_counter < (_ammmounts select _forEachIndex)} do {
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_backpackMoney set [count(_backpackMoney),_x];
|
_backpackMoney set [count(_backpackMoney),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
@@ -45,9 +45,9 @@ if( Z_AllowTakingMoneyFromBackpack ) then {
|
|||||||
_findGem = DZE_GemList find _x;
|
_findGem = DZE_GemList find _x;
|
||||||
if (_findGem >= 0) then {
|
if (_findGem >= 0) then {
|
||||||
_worth = DZE_GemWorthList select _findGem;
|
_worth = DZE_GemWorthList select _findGem;
|
||||||
_total_currency = _total_currency + (_worth * (_ammmounts select _forEachIndex));
|
_total_currency = _total_currency + (_worth * (_amounts select _forEachIndex));
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{_counter < (_ammmounts select _forEachIndex)} do {
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_backpackMoney set [count(_backpackMoney),_x];
|
_backpackMoney set [count(_backpackMoney),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
@@ -58,19 +58,19 @@ if( Z_AllowTakingMoneyFromBackpack ) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if( Z_AllowTakingMoneyFromVehicle ) then {
|
if (Z_AllowTakingMoneyFromVehicle) then {
|
||||||
if (!isNull Z_vehicle) then {
|
if (!isNull Z_vehicle) then {
|
||||||
_mags = getMagazineCargo Z_vehicle;
|
_mags = getMagazineCargo Z_vehicle;
|
||||||
_vehicleMoney = [];
|
_vehicleMoney = [];
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_part = (configFile >> "CfgMagazines" >> _x);
|
_part = (configFile >> "CfgMagazines" >> _x);
|
||||||
_worth = (_part >> "worth");
|
_worth = (_part >> "worth");
|
||||||
if isNumber (_worth) then {
|
if isNumber (_worth) then {
|
||||||
_total_currency = _total_currency + ( getNumber(_worth) * (_ammmounts select _forEachIndex));
|
_total_currency = _total_currency + (getNumber(_worth) * (_amounts select _forEachIndex));
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{_counter < ( _ammmounts select _forEachIndex)}do{
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_vehicleMoney set [count(_vehicleMoney),_x];
|
_vehicleMoney set [count(_vehicleMoney),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
@@ -78,9 +78,9 @@ if( Z_AllowTakingMoneyFromVehicle ) then {
|
|||||||
_findGem = DZE_GemList find _x;
|
_findGem = DZE_GemList find _x;
|
||||||
if (_findGem >= 0) then {
|
if (_findGem >= 0) then {
|
||||||
_worth = DZE_GemWorthList select _findGem;
|
_worth = DZE_GemWorthList select _findGem;
|
||||||
_total_currency = _total_currency + (_worth * (_ammmounts select _forEachIndex));
|
_total_currency = _total_currency + (_worth * (_amounts select _forEachIndex));
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{_counter < (_ammmounts select _forEachIndex)} do {
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_backpackMoney set [count(_backpackMoney),_x];
|
_backpackMoney set [count(_backpackMoney),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
@@ -91,7 +91,7 @@ if( Z_AllowTakingMoneyFromVehicle ) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( _totalToPay <= _total_currency) then {
|
if (_totalToPay <= _total_currency) then {
|
||||||
_return set [0, true];
|
_return set [0, true];
|
||||||
_return set [4, _total_currency];
|
_return set [4, _total_currency];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if (Z_Selling) then {
|
|||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER";
|
||||||
{ctrlShow [_x,true];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON,Z_AT_FILTERBOX]; // show
|
{ctrlShow [_x,true];} forEach [Z_AT_SELLABLELIST,Z_AT_SELLINGLIST,Z_AT_SELLBUTTON,Z_AT_ADDSELLITEMBUTTON,Z_AT_ADDALLSELLITEMBUTTON,Z_AT_REMOVESELLITEMBUTTON,Z_AT_REMOVEALLSELLITEMBUTTON,Z_AT_FILTERBOX]; // show
|
||||||
{ctrlShow [_x,false];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_BACKBUTTON]; // hide
|
{ctrlShow [_x,false];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_BACKBUTTON]; // hide
|
||||||
}else{
|
} else {
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SELLBUYTOGGLE) ctrlSetText localize "STR_EPOCH_PLAYER_292";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SELLBUYTOGGLE) ctrlSetText localize "STR_EPOCH_PLAYER_292";
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_FILTERBUTTON) ctrlSetText localize "STR_UI_FILTER";
|
||||||
{ctrlShow [_x,true];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_FILTERBOX,Z_AT_BACKBUTTON]; // show
|
{ctrlShow [_x,true];} forEach [Z_AT_BUYABLELIST,Z_AT_BUYINGLIST,Z_AT_BUYBUTTON,Z_AT_ADDBUYITEMBUTTON,Z_AT_BUYINGAMOUNT,Z_AT_REMOVEBUYITEMBUTTON,Z_AT_REMOVEALLBUYITEMBUTTON,Z_AT_SLOTSDISPLAY,Z_AT_FILTERBOX,Z_AT_BACKBUTTON]; // show
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Fills up the sell or buy list if the item has a valid config.
|
* Fills up the sell or buy list if the item has a valid config.
|
||||||
**/
|
**/
|
||||||
private ["_weaps","_mags","_extraText","_all","_total","_arrayOfTraderCat","_totalPrice","_ctrltext","_backUpText","_bags"];
|
private ["_weaps","_mags","_extraText","_all","_arrayOfTraderCat","_totalPrice","_backUpText","_bags"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_weaps = _this select 0;
|
_weaps = _this select 0;
|
||||||
@@ -16,13 +16,14 @@ _mags = _this select 1;
|
|||||||
_extraText = _this select 2;
|
_extraText = _this select 2;
|
||||||
_bags = _this select 3;
|
_bags = _this select 3;
|
||||||
_vehTrade = false;
|
_vehTrade = false;
|
||||||
|
|
||||||
if (false call Z_checkCloseVehicle) then {
|
if (false call Z_checkCloseVehicle) then {
|
||||||
_all = _weaps + _mags + _bags + [(typeOf Z_vehicle)];
|
_all = _weaps + _mags + _bags + [(typeOf Z_vehicle)];
|
||||||
_vehTrade = true;
|
_vehTrade = true;
|
||||||
} else {
|
} else {
|
||||||
_all = _weaps + _mags + _bags;
|
_all = _weaps + _mags + _bags;
|
||||||
};
|
};
|
||||||
_total = count(_all);
|
|
||||||
_arrayOfTraderCat = Z_traderData;
|
_arrayOfTraderCat = Z_traderData;
|
||||||
_HasKeyCheck = {
|
_HasKeyCheck = {
|
||||||
_obj = _this select 0;
|
_obj = _this select 0;
|
||||||
@@ -44,92 +45,80 @@ _HasKeyCheck = {
|
|||||||
_keyFound;
|
_keyFound;
|
||||||
};
|
};
|
||||||
_totalPrice = 0;
|
_totalPrice = 0;
|
||||||
if(_total > 0)then{
|
|
||||||
|
{
|
||||||
|
_y = _x;
|
||||||
{
|
{
|
||||||
_y = _x;
|
private ["_cat","_exists","_pic","_text","_type","_sell","_buy","_buyCurrency","_sellCurrency","_worth"];
|
||||||
{
|
_cat = format["Category_%1",(_arrayOfTraderCat select _forEachIndex select 1)];
|
||||||
private ["_cat","_excists","_pic","_text","_type","_sell","_buy","_buyCurrency","_sellCurrency","_worth"];
|
if (isNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")) then {
|
||||||
_cat = format["Category_%1",(_arrayOfTraderCat select _forEachIndex select 1)];
|
_cat = format["Category_%1",getNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")];
|
||||||
if (isNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")) then {
|
};
|
||||||
_cat = format["Category_%1",getNumber (missionConfigFile >> "CfgTraderCategory" >> _cat >> "duplicate")];
|
_exists = isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y);
|
||||||
|
if (_exists) exitWith {
|
||||||
|
_pic = "";
|
||||||
|
_text = "";
|
||||||
|
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
||||||
|
_sell = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "sell");
|
||||||
|
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
||||||
|
switch (true) do {
|
||||||
|
case (_type == "trade_items") :
|
||||||
|
{
|
||||||
|
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
||||||
|
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
||||||
|
};
|
||||||
|
case (_type == "trade_weapons") :
|
||||||
|
{
|
||||||
|
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
||||||
|
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
||||||
|
};
|
||||||
|
case (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) :
|
||||||
|
{
|
||||||
|
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
||||||
|
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
||||||
|
};
|
||||||
};
|
};
|
||||||
_excists = isClass(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y );
|
|
||||||
if(_excists)exitWith{
|
|
||||||
_pic = "";
|
|
||||||
_text = "";
|
|
||||||
_type = getText(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "type");
|
|
||||||
_sell = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "sell");
|
|
||||||
_buy = getArray(missionConfigFile >> "CfgTraderCategory" >> _cat >> _y >> "buy");
|
|
||||||
switch (true) do {
|
|
||||||
case (_type == "trade_items") :
|
|
||||||
{
|
|
||||||
_pic = getText (configFile >> 'CfgMagazines' >> _y >> 'picture');
|
|
||||||
_text = getText (configFile >> 'CfgMagazines' >> _y >> 'displayName');
|
|
||||||
};
|
|
||||||
case (_type == "trade_weapons") :
|
|
||||||
{
|
|
||||||
_pic = getText (configFile >> 'CfgWeapons' >> _y >> 'picture');
|
|
||||||
_text = getText (configFile >> 'CfgWeapons' >> _y >> 'displayName');
|
|
||||||
};
|
|
||||||
case (_type in ["trade_backpacks", "trade_any_vehicle", "trade_any_vehicle_free", "trade_any_vehicle_old", "trade_any_bicycle", "trade_any_bicycle_old", "trade_any_boat", "trade_any_boat_old"]) :
|
|
||||||
{
|
|
||||||
_pic = getText (configFile >> 'CfgVehicles' >> _y >> 'picture');
|
|
||||||
_text = getText (configFile >> 'CfgVehicles' >> _y >> 'displayName');
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
if( isNil '_text')then{
|
if (isNil '_text') then { _text = _y; };
|
||||||
_text = _y;
|
_HasKey = true;
|
||||||
|
if (_vehTrade && {(typeOf Z_vehicle) == _y}) then {
|
||||||
|
if (!(_type in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"]) && DZE_SaleRequiresKey) then {
|
||||||
|
_HasKey = [Z_vehicle, _all] call _HasKeyCheck;
|
||||||
};
|
};
|
||||||
_HasKey = true;
|
|
||||||
if (_vehTrade && {(typeOf Z_vehicle) == _y}) then {
|
|
||||||
if (!(_type in ["trade_any_bicycle", "trade_any_bicycle_old", "trade_any_vehicle_free"]) && DZE_SaleRequiresKey) then {
|
|
||||||
_HasKey = [Z_vehicle, _all] call _HasKeyCheck;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
if (!_HasKey) exitWith {};
|
|
||||||
|
|
||||||
_worth = 0;
|
|
||||||
|
|
||||||
if(!Z_SingleCurrency) then {
|
|
||||||
_buyCurrency = _buy select 1;
|
|
||||||
_sellCurrency = _sell select 1;
|
|
||||||
_part = (configFile >> "CfgMagazines" >> _sellCurrency);
|
|
||||||
_worth = getNumber(_part >> "worth");
|
|
||||||
if (_worth == 0) then {
|
|
||||||
_worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency);
|
|
||||||
};
|
|
||||||
}else{
|
|
||||||
_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]];
|
|
||||||
_totalPrice = _totalPrice + (_sell select 0);
|
|
||||||
};
|
};
|
||||||
}forEach _arrayOfTraderCat;
|
if (!_HasKey) exitWith {};
|
||||||
}count _all;
|
|
||||||
|
|
||||||
Z_OriginalSellableArray = [] + Z_SellableArray;
|
_worth = 0;
|
||||||
|
|
||||||
_backUpText = _extraText;
|
if (!Z_SingleCurrency) then {
|
||||||
|
_buyCurrency = _buy select 1;
|
||||||
|
_sellCurrency = _sell select 1;
|
||||||
|
_part = (configFile >> "CfgMagazines" >> _sellCurrency);
|
||||||
|
_worth = getNumber(_part >> "worth");
|
||||||
|
if (_worth == 0) then { _worth = DZE_GemWorthList select (DZE_GemList find _buyCurrency); };
|
||||||
|
} else {
|
||||||
|
_buyCurrency = CurrencyName;
|
||||||
|
_sellCurrency = CurrencyName;
|
||||||
|
};
|
||||||
|
|
||||||
if(Z_SellingFrom != 2)then{
|
Z_SellableArray set [count(Z_SellableArray) , [_y, _type, _sell select 0, _text, _pic, _forEachIndex, _buy select 0, _sellCurrency, _buyCurrency, 0 ,_cat, _worth]];
|
||||||
_extraText = getText (configFile >> 'CfgVehicles' >> _extraText >> 'displayName');
|
_totalPrice = _totalPrice + (_sell select 0);
|
||||||
};
|
};
|
||||||
if (isNil '_extraText')then{
|
} forEach _arrayOfTraderCat;
|
||||||
_extraText = _backUpText;
|
} count _all;
|
||||||
};
|
|
||||||
|
|
||||||
if (Z_SingleCurrency) then {
|
Z_OriginalSellableArray = [] + Z_SellableArray;
|
||||||
_ctrltext = format[localize "STR_EPOCH_TRADE_OFFER", _totalPrice,CurrencyName];
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, _ctrltext];
|
|
||||||
} else {
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, ''];
|
|
||||||
};
|
|
||||||
|
|
||||||
_ctrltext = format[localize "STR_EPOCH_TRADE_ACCEPT", count(Z_SellableArray) , _extraText];
|
_backUpText = _extraText;
|
||||||
ctrlSetText [Z_AT_TRADERLINE1, _ctrltext];
|
|
||||||
|
|
||||||
call Z_fillSellList;
|
if (Z_SellingFrom != 2) then { _extraText = getText (configFile >> 'CfgVehicles' >> _extraText >> 'displayName'); };
|
||||||
|
if (isNil '_extraText') then { _extraText = _backUpText; };
|
||||||
|
|
||||||
|
if (Z_SingleCurrency) then {
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE2, format[localize "STR_EPOCH_TRADE_OFFER", _totalPrice,CurrencyName]];
|
||||||
|
} else {
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE2, ''];
|
||||||
};
|
};
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE1, format[localize "STR_EPOCH_TRADE_ACCEPT", count(Z_SellableArray) , _extraText]];
|
||||||
|
|
||||||
|
call Z_fillSellList;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_vehicle","_list","_result","_pos"];
|
private ["_vehicle","_list","_result","_pos"];
|
||||||
|
|
||||||
Z_vehicle = objNull;
|
Z_vehicle = objNull;
|
||||||
_vehicle = objNull;
|
_vehicle = objNull;
|
||||||
_pos = [player] call FNC_GetPos;
|
_pos = [player] call FNC_GetPos;
|
||||||
@@ -7,9 +8,10 @@ _list = nearestObjects [_pos, ["Air","LandVehicle","Ship"], Z_VehicleDistance];
|
|||||||
if (!isNull _x && local _x && alive _x) then {
|
if (!isNull _x && local _x && alive _x) then {
|
||||||
_vehicle = _x;
|
_vehicle = _x;
|
||||||
};
|
};
|
||||||
}count _list;
|
} count _list;
|
||||||
_result = false;
|
_result = false;
|
||||||
if(!isNull _vehicle)then{
|
|
||||||
|
if (!isNull _vehicle) then {
|
||||||
Z_vehicle = _vehicle;
|
Z_vehicle = _vehicle;
|
||||||
_result = true;
|
_result = true;
|
||||||
if (_this) then { // Set trade title, don't set on menu start up since gear is selected initially.
|
if (_this) then { // Set trade title, don't set on menu start up since gear is selected initially.
|
||||||
@@ -21,4 +23,5 @@ if(!isNull _vehicle)then{
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
_result
|
_result
|
||||||
|
|||||||
@@ -4,5 +4,6 @@
|
|||||||
* Clears the visual listbox of items you could buy.
|
* Clears the visual listbox of items you could buy.
|
||||||
**/
|
**/
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
lbClear Z_AT_BUYABLELIST;
|
lbClear Z_AT_BUYABLELIST;
|
||||||
lbSetCurSel [Z_AT_BUYABLELIST,-1]; // clear
|
lbSetCurSel [Z_AT_BUYABLELIST,-1]; // clear
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
*
|
*
|
||||||
* Clears the visual listbox of items you were going to buy.
|
* Clears the visual listbox of items you were going to buy.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
lbClear Z_AT_BUYINGLIST;
|
lbClear Z_AT_BUYINGLIST;
|
||||||
@@ -4,5 +4,6 @@
|
|||||||
* Clears the visual listbox of items you were going to sell and could be selled.
|
* Clears the visual listbox of items you were going to sell and could be selled.
|
||||||
**/
|
**/
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
lbClear Z_AT_SELLABLELIST;
|
lbClear Z_AT_SELLABLELIST;
|
||||||
lbClear Z_AT_SELLINGLIST;
|
lbClear Z_AT_SELLINGLIST;
|
||||||
@@ -4,4 +4,5 @@
|
|||||||
* Clears the visual listbox of items you were going to sell.
|
* Clears the visual listbox of items you were going to sell.
|
||||||
**/
|
**/
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
lbClear Z_AT_SELLABLELIST;
|
lbClear Z_AT_SELLABLELIST;
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
private ["_item","_picture","_class","_display","_transportMaxWeapons","_transportMaxMagazines","_transportmaxBackpacks","_buyPrice","_sellPrice"
|
private ["_item","_picture","_class","_display","_transportMaxWeapons","_transportMaxMagazines","_transportmaxBackpacks","_buyPrice","_sellPrice","_buyCurrency","_sellCurrency","_formattedText","_picBuy","_picSell"];
|
||||||
,"_buyCurrency","_sellCurrency","_formattedText","_picBuy","_picSell"
|
|
||||||
];
|
|
||||||
|
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
@@ -15,27 +12,27 @@ _transportMaxMagazines = 0;
|
|||||||
|
|
||||||
_buyPrice = 0;
|
_buyPrice = 0;
|
||||||
_sellPrice = 0;
|
_sellPrice = 0;
|
||||||
if(Z_Selling)then{
|
if (Z_Selling) then {
|
||||||
_buyPrice = _item select 6;
|
_buyPrice = _item select 6;
|
||||||
_buyCurrency = _item select 8;
|
_buyCurrency = _item select 8;
|
||||||
_sellPrice = _item select 2;
|
_sellPrice = _item select 2;
|
||||||
_sellCurrency = _item select 7;
|
_sellCurrency = _item select 7;
|
||||||
}else{
|
} else {
|
||||||
_buyPrice = _item select 2;
|
_buyPrice = _item select 2;
|
||||||
_buyCurrency = _item select 7;
|
_buyCurrency = _item select 7;
|
||||||
_sellPrice = _item select 6;
|
_sellPrice = _item select 6;
|
||||||
_sellCurrency = _item select 8;
|
_sellCurrency = _item select 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( isNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxWeapons')) then {
|
if (isNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxWeapons')) then {
|
||||||
_transportMaxWeapons = getNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxWeapons');
|
_transportMaxWeapons = getNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxWeapons');
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( isNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxMagazines')) then {
|
if (isNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxMagazines')) then {
|
||||||
_transportMaxMagazines = getNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxMagazines');
|
_transportMaxMagazines = getNumber (configFile >> 'CfgVehicles' >> _class >> 'transportMaxMagazines');
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( Z_SingleCurrency ) then {
|
if (Z_SingleCurrency) then {
|
||||||
_buyCurrency = CurrencyName;
|
_buyCurrency = CurrencyName;
|
||||||
_sellCurrency = CurrencyName;
|
_sellCurrency = CurrencyName;
|
||||||
_formattedText = format [
|
_formattedText = format [
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
private ['_item','_picture','_class','_display','_buyPrice','_sellPrice','_formattedText','_buyCurrency','_sellCurrency','_compatible','_weapon','_attach','_config','_compatibleText','_type','_text'];
|
private ['_item','_picture','_class','_display','_buyPrice','_sellPrice','_formattedText','_buyCurrency','_sellCurrency','_compatible','_weapon','_attach','_config','_compatibleText','_type','_text'];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
_picture = _item select 4;
|
_picture = _item select 4;
|
||||||
_class = _item select 0;
|
_class = _item select 0;
|
||||||
_display = _item select 3;
|
_display = _item select 3;
|
||||||
_buyPrice = 0;
|
_buyPrice = 0;
|
||||||
_sellPrice = 0;
|
_sellPrice = 0;
|
||||||
|
|
||||||
if (Z_Selling) then {
|
if (Z_Selling) then {
|
||||||
_buyPrice = _item select 6;
|
_buyPrice = _item select 6;
|
||||||
_buyCurrency = _item select 8;
|
_buyCurrency = _item select 8;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
private ['_item', '_type','_picture',"_class","_display","_transportMaxWeapons","_transportMaxMagazines","_transportmaxBackpacks"
|
private ['_item', '_type','_picture',"_class","_display","_transportMaxWeapons","_transportMaxMagazines","_transportmaxBackpacks"
|
||||||
,"_buyPrice","_sellPrice","_buyCurrency","_sellCurrency","_formattedText","_fuelCapacity","_maxSpeed","_armor","_seats","_weapons",
|
,"_buyPrice","_sellPrice","_buyCurrency","_sellCurrency","_formattedText","_fuelCapacity","_maxSpeed","_armor","_seats","_weapons",
|
||||||
"_weapons2","_config","_wepText","_turret","_text"
|
"_weapons2","_config","_wepText","_turret","_text"];
|
||||||
];
|
|
||||||
|
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
@@ -129,7 +128,6 @@ if (Z_SingleCurrency) then {
|
|||||||
, _picture, _display, _class, _transportmaxBackpacks, _sellPrice, _buyPrice, CurrencyName, _transportMaxWeapons,_transportMaxMagazines, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_MAGS", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_BAGS",
|
, _picture, _display, _class, _transportmaxBackpacks, _sellPrice, _buyPrice, CurrencyName, _transportMaxWeapons,_transportMaxMagazines, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291", localize "STR_EPOCH_MAGS", localize "STR_EPOCH_WEPS", localize "STR_EPOCH_BAGS",
|
||||||
localize "STR_EPOCH_ARMOR",_armor,localize "STR_EPOCH_FUEL",_fuelCapacity,localize "STR_EPOCH_MAX",localize "STR_EPOCH_SPEED",_maxSpeed,localize "STR_EPOCH_SEATS",_seats,localize "STR_EPOCH_WEAPONS",_wepText
|
localize "STR_EPOCH_ARMOR",_armor,localize "STR_EPOCH_FUEL",_fuelCapacity,localize "STR_EPOCH_MAX",localize "STR_EPOCH_SPEED",_maxSpeed,localize "STR_EPOCH_SEATS",_seats,localize "STR_EPOCH_WEAPONS",_wepText
|
||||||
];
|
];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ _attachText = "";
|
|||||||
} forEach _attachments;
|
} forEach _attachments;
|
||||||
|
|
||||||
_magazines = [];
|
_magazines = [];
|
||||||
if( isArray (configFile >> 'CfgWeapons' >> _class >> 'magazines')) then {
|
if (isArray (configFile >> 'CfgWeapons' >> _class >> 'magazines')) then {
|
||||||
{
|
{
|
||||||
_magazines set [count _magazines, getText (configFile >> "CfgMagazines" >> _x >> "displayName")];
|
_magazines set [count _magazines, getText (configFile >> "CfgMagazines" >> _x >> "displayName")];
|
||||||
} forEach (getArray (configFile >> 'CfgWeapons' >> _class >> 'magazines'));
|
} forEach (getArray (configFile >> 'CfgWeapons' >> _class >> 'magazines'));
|
||||||
@@ -53,13 +53,13 @@ if( isArray (configFile >> 'CfgWeapons' >> _class >> 'magazines')) then {
|
|||||||
_magText = "";
|
_magText = "";
|
||||||
|
|
||||||
{
|
{
|
||||||
if( _forEachIndex > 0) then {
|
if (_forEachIndex > 0) then {
|
||||||
_magText = _magText + ', ' + _x;
|
_magText = _magText + ', ' + _x;
|
||||||
} else {
|
} else {
|
||||||
_magText = _magText + _x;
|
_magText = _magText + _x;
|
||||||
};
|
};
|
||||||
|
|
||||||
}foreach _magazines;
|
} foreach _magazines;
|
||||||
|
|
||||||
if (Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
_formattedText = format [
|
_formattedText = format [
|
||||||
@@ -70,7 +70,7 @@ if (Z_SingleCurrency) then {
|
|||||||
"<t color='#33BFFF' size='0.8'>%10: </t><t color='#ffffff' size='0.8'>%5 %7</t><br />"
|
"<t color='#33BFFF' size='0.8'>%10: </t><t color='#ffffff' size='0.8'>%5 %7</t><br />"
|
||||||
, _picture, _display, _class, _magText, _sellPrice, _buyPrice, CurrencyName, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291"
|
, _picture, _display, _class, _magText, _sellPrice, _buyPrice, CurrencyName, localize "STR_EPOCH_NAME", localize "STR_EPOCH_CLASS", localize "STR_EPOCH_PLAYER_292", localize "STR_EPOCH_PLAYER_291"
|
||||||
];
|
];
|
||||||
}else {
|
} else {
|
||||||
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
_picSell = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'picture');
|
||||||
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
_sellCurrency = getText (configFile >> 'CfgMagazines' >> _sellCurrency >> 'displayName');
|
||||||
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
_picBuy = getText (configFile >> 'CfgMagazines' >> _buyCurrency >> 'picture');
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_BUYABLELIST, _x select 3];
|
_index = lbAdd [Z_AT_BUYABLELIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_BUYABLELIST, _index, _x select 4 ];
|
lbSetPicture [Z_AT_BUYABLELIST, _index, _x select 4 ];
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_BUYINGLIST, _x select 3];
|
_index = lbAdd [Z_AT_BUYINGLIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_BUYINGLIST, _index, _x select 4];
|
lbSetPicture [Z_AT_BUYINGLIST, _index, _x select 4];
|
||||||
}count Z_BuyingArray;
|
} count Z_BuyingArray;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
private "_index";
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
call Z_clearBuyList;
|
call Z_clearBuyList;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
*
|
*
|
||||||
* Visualy fills in the listbox of items that can be sold.
|
* Visualy fills in the listbox of items that can be sold.
|
||||||
**/
|
**/
|
||||||
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
{
|
{
|
||||||
_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 ];
|
||||||
}count Z_SellableArray;
|
} count Z_SellableArray;
|
||||||
|
|||||||
@@ -3,8 +3,10 @@
|
|||||||
*
|
*
|
||||||
* Visualy fills in the listbox of items currently being sold.
|
* Visualy fills in the listbox of items currently being sold.
|
||||||
**/
|
**/
|
||||||
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
{
|
{
|
||||||
_index = lbAdd [Z_AT_SELLINGLIST, _x select 3];
|
_index = lbAdd [Z_AT_SELLINGLIST, _x select 3];
|
||||||
lbSetPicture [Z_AT_SELLINGLIST, _index, _x select 4];
|
lbSetPicture [Z_AT_SELLINGLIST, _index, _x select 4];
|
||||||
}count Z_SellArray;
|
} count Z_SellArray;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
*
|
*
|
||||||
* Changes the indication of where you are selling/buying from in the trade window.
|
* Changes the indication of where you are selling/buying from in the trade window.
|
||||||
**/
|
**/
|
||||||
|
private "_text";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_text = _this select 0;
|
_text = _this select 0;
|
||||||
ctrlSetText [Z_AT_CONTAINERINDICATOR, _text];
|
ctrlSetText [Z_AT_CONTAINERINDICATOR, _text];
|
||||||
@@ -5,15 +5,16 @@
|
|||||||
*
|
*
|
||||||
* Filters the buyable or sellable list on your input.
|
* Filters the buyable or sellable list on your input.
|
||||||
**/
|
**/
|
||||||
|
private ["_query","_newSellArray","_newBuyArray"];
|
||||||
|
|
||||||
if(count _this > 0) then {
|
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 {
|
||||||
_newSellArray set [count(_newSellArray), _x];
|
_newSellArray set [count(_newSellArray), _x];
|
||||||
};
|
};
|
||||||
} forEach Z_OriginalSellableArray;
|
} forEach Z_OriginalSellableArray;
|
||||||
@@ -22,11 +23,11 @@ if(count _this > 0) then {
|
|||||||
|
|
||||||
call Z_clearSellableList;
|
call Z_clearSellableList;
|
||||||
call Z_fillSellList;
|
call Z_fillSellList;
|
||||||
}else {
|
} else {
|
||||||
_newSellArray = [];
|
_newSellArray = [];
|
||||||
{
|
{
|
||||||
if(( [_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString) ) then {
|
if (([_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString)) then {
|
||||||
if( _x find Z_SellArray < 0 ) then {
|
if (_x find Z_SellArray < 0) then {
|
||||||
_newSellArray set [count(_newSellArray), _x];
|
_newSellArray set [count(_newSellArray), _x];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -35,15 +36,15 @@ if(count _this > 0) then {
|
|||||||
call Z_clearSellableList;
|
call Z_clearSellableList;
|
||||||
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;
|
||||||
}else {
|
} else {
|
||||||
_newBuyArray = [];
|
_newBuyArray = [];
|
||||||
{
|
{
|
||||||
if(( [_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString) ) then {
|
if (([_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString)) then {
|
||||||
_newBuyArray set [count(_newBuyArray), _x];
|
_newBuyArray set [count(_newBuyArray), _x];
|
||||||
};
|
};
|
||||||
} forEach Z_OriginalBuyableArray;
|
} forEach Z_OriginalBuyableArray;
|
||||||
|
|||||||
@@ -3,12 +3,14 @@
|
|||||||
*
|
*
|
||||||
* Gets all your items stored in your backpack and innitiates the selling list.
|
* Gets all your items stored in your backpack and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
|
private ["_backpack","_pic","_formattedText","_mags","_weaps","_normalMags","_normalWeaps","_kinds","_kinds2","_amounts","_amounts2"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
private ["_backpack","_pic","_formattedText","_mags","_weaps","_normalMags","_normalWeaps","_kinds","_kinds2","_ammmounts","_ammmounts2","_ctrltext"];
|
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
Z_SellArray = [];
|
Z_SellArray = [];
|
||||||
_backpack = unitBackpack player;
|
_backpack = unitBackpack player;
|
||||||
|
|
||||||
if (!isNull _backpack) then {
|
if (!isNull _backpack) then {
|
||||||
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'picture');
|
_pic = getText (configFile >> 'CfgVehicles' >> (typeOf _backpack) >> 'picture');
|
||||||
|
|
||||||
@@ -24,30 +26,24 @@ if (!isNull _backpack) then {
|
|||||||
_normalMags = [];
|
_normalMags = [];
|
||||||
_normalWeaps = [];
|
_normalWeaps = [];
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts select _forEachIndex)}do{
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_normalMags set [count(_normalMags),_x];
|
_normalMags set [count(_normalMags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds;
|
} forEach _kinds;
|
||||||
|
|
||||||
_kinds2 = _weaps select 0;
|
_kinds2 = _weaps select 0;
|
||||||
_ammmounts2 = _weaps select 1;
|
_amounts2 = _weaps select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts2 select _forEachIndex)}do{
|
while {_counter < (_amounts2 select _forEachIndex)} do {
|
||||||
_normalWeaps set [count(_normalWeaps),_x];
|
_normalWeaps set [count(_normalWeaps),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds2;
|
} forEach _kinds2;
|
||||||
|
|
||||||
[_normalMags,_normalWeaps, typeOf _backpack,[]] call Z_checkArrayInConfig;
|
[_normalMags,_normalWeaps, typeOf _backpack,[]] call Z_checkArrayInConfig;
|
||||||
}else{
|
|
||||||
_ctrltext = localize "STR_EPOCH_TRADE_STUPID";
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, _ctrltext];
|
|
||||||
|
|
||||||
_ctrltext = localize "STR_EPOCH_TRADE_NO_BACKPACK";
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE1, _ctrltext];
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* call Z_getContainer
|
* call Z_getContainer
|
||||||
*
|
*
|
||||||
* Switches between selling and buying and the item container (gear/vehicle/bakcpack) and initiates item loading.
|
* Switches between selling and buying and the item container (gear/vehicle/backpack) and initiates item loading.
|
||||||
**/
|
**/
|
||||||
private ["_lbIndex","_canBuyInVehicle"];
|
private ["_lbIndex","_canBuyInVehicle","_backpack"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["0 / 0 / 0"];
|
|
||||||
if (Z_Selling) then {
|
if (Z_Selling) then {
|
||||||
call Z_clearBuyingList;
|
call Z_clearBuyingList;
|
||||||
Z_BuyingArray = [];
|
Z_BuyingArray = [];
|
||||||
@@ -15,22 +15,34 @@ Z_SellableArray = [];
|
|||||||
Z_SellArray = [];
|
Z_SellArray = [];
|
||||||
|
|
||||||
_lbIndex = _this select 0;
|
_lbIndex = _this select 0;
|
||||||
|
_backpack = unitBackpack player;
|
||||||
|
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText "";
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_ITEMINFO) ctrlSetStructuredText parseText "";
|
||||||
|
|
||||||
call Z_calcPrice;
|
call Z_calcPrice;
|
||||||
|
|
||||||
if(Z_Selling)then{
|
if (Z_Selling) then {
|
||||||
switch (_lbIndex) do {
|
switch (_lbIndex) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
[localize "STR_EPOCH_TRADE_SELLING_BACKPACK"] call Z_filleTradeTitle;
|
if (!isNull _backpack) then {
|
||||||
Z_SellingFrom = 0;
|
[localize "STR_EPOCH_TRADE_SELLING_BACKPACK"] call Z_filleTradeTitle;
|
||||||
call Z_getBackpackItems;
|
Z_SellingFrom = 0;
|
||||||
|
call Z_getBackpackItems;
|
||||||
|
} else {
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_NO_BACKPACK"];
|
||||||
|
ctrlSetText [Z_AT_SLOTSDISPLAY, " "];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case 1: {
|
case 1: {
|
||||||
[localize "STR_EPOCH_TRADE_SELLING_VEHICLE"] call Z_filleTradeTitle;
|
_canBuyInVehicle = true call Z_checkCloseVehicle;
|
||||||
Z_SellingFrom = 1;
|
if (_canBuyInVehicle) then {
|
||||||
call Z_getVehicleItems;
|
[localize "STR_EPOCH_TRADE_SELLING_VEHICLE"] call Z_filleTradeTitle;
|
||||||
|
Z_SellingFrom = 1;
|
||||||
|
call Z_getVehicleItems;
|
||||||
|
} else {
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_PLAYER_245"];
|
||||||
|
ctrlSetText [Z_AT_SLOTSDISPLAY, " "];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
[localize "STR_EPOCH_TRADE_SELLING_GEAR"] call Z_filleTradeTitle;
|
[localize "STR_EPOCH_TRADE_SELLING_GEAR"] call Z_filleTradeTitle;
|
||||||
@@ -38,24 +50,29 @@ if(Z_Selling)then{
|
|||||||
call Z_getGearItems;
|
call Z_getGearItems;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}else{
|
} else {
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, " "];
|
ctrlSetText [Z_AT_TRADERLINE2, " "];
|
||||||
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_SELLING_ALL"];
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_SELLING_ALL"];
|
||||||
switch (_lbIndex) do {
|
switch (_lbIndex) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
Z_SellingFrom = 0;
|
if (!isNull _backpack) then {
|
||||||
[localize "STR_EPOCH_TRADE_BUYING_BACKPACK"] call Z_filleTradeTitle;
|
Z_SellingFrom = 0;
|
||||||
[0] call Z_calculateFreeSpace;
|
[localize "STR_EPOCH_TRADE_BUYING_BACKPACK"] call Z_filleTradeTitle;
|
||||||
|
[0] call Z_calculateFreeSpace;
|
||||||
|
} else {
|
||||||
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_TRADE_NO_BACKPACK"];
|
||||||
|
ctrlSetText [Z_AT_SLOTSDISPLAY, " "];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
case 1: {
|
case 1: {
|
||||||
Z_SellingFrom = 1;
|
|
||||||
[localize "STR_EPOCH_TRADE_BUYING_VEHICLE"] call Z_filleTradeTitle;
|
|
||||||
_canBuyInVehicle = true call Z_checkCloseVehicle;
|
_canBuyInVehicle = true call Z_checkCloseVehicle;
|
||||||
if(_canBuyInVehicle)then{
|
if (_canBuyInVehicle) then {
|
||||||
|
Z_SellingFrom = 1;
|
||||||
|
[localize "STR_EPOCH_TRADE_BUYING_VEHICLE"] call Z_filleTradeTitle;
|
||||||
[1] call Z_calculateFreeSpace;
|
[1] call Z_calculateFreeSpace;
|
||||||
}else{
|
} else {
|
||||||
systemChat localize "STR_EPOCH_PLAYER_245";
|
ctrlSetText [Z_AT_TRADERLINE1, localize "STR_EPOCH_PLAYER_245"];
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_SLOTSDISPLAY) ctrlSetText format["%1 / %2 / %3",0,0,0];
|
ctrlSetText [Z_AT_SLOTSDISPLAY, " "];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case 2: {
|
case 2: {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* call Z_getBackpackItems
|
* call Z_getGearItems
|
||||||
*
|
*
|
||||||
* Gets all your items stored in your gear and innitiates the selling list.
|
* Gets all your items stored in your gear and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags"];
|
private ["_mags","_weaps","_skin","_formattedText","_bag","_bags","_pic"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellArray = [];
|
Z_SellArray = [];
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
@@ -23,4 +24,4 @@ _formattedText = format [
|
|||||||
|
|
||||||
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
|
(findDisplay Z_AT_DIALOGWINDOW displayCtrl Z_AT_CONTAINERINFO) ctrlSetStructuredText parseText _formattedText;
|
||||||
|
|
||||||
[_weaps,_mags,localize "STR_EPOCH_YOUR_GEAR",_bags] call Z_checkArrayInConfig;
|
[_weaps,_mags,toLower (localize "STR_UI_GEAR"),_bags] call Z_checkArrayInConfig;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include "defines.hpp"
|
|
||||||
private ['_item', '_type'];
|
private ['_item', '_type'];
|
||||||
|
#include "defines.hpp"
|
||||||
|
|
||||||
_item = _this select 0;
|
_item = _this select 0;
|
||||||
_type = _item select 1;
|
_type = _item select 1;
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ _selectedIndex = _this select 1;
|
|||||||
|
|
||||||
_item = [];
|
_item = [];
|
||||||
|
|
||||||
if(_selectedIndex >= 0) then {
|
if (_selectedIndex >= 0) then {
|
||||||
switch(_selectedList) do {
|
switch (_selectedList) do {
|
||||||
case 'sellable': {
|
case 'sellable': {
|
||||||
_item = Z_SellableArray select _selectedIndex;
|
_item = Z_SellableArray select _selectedIndex;
|
||||||
};
|
};
|
||||||
@@ -27,6 +27,6 @@ if(_selectedIndex >= 0) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if( count _item > 0) then {
|
if (count _item > 0) then {
|
||||||
[_item] call Z_getItemConfig;
|
[_item] call Z_getItemConfig;
|
||||||
};
|
};
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
/**
|
/**
|
||||||
* call Z_getBackpackItems
|
* call Z_getVehicleItems
|
||||||
*
|
*
|
||||||
* Gets all your items stored in your vehicle and innitiates the selling list.
|
* Gets all your items stored in your vehicle and innitiates the selling list.
|
||||||
**/
|
**/
|
||||||
|
private ["_vehicle","_pos","_list","_formattedText","_pic","_mags","_weaps","_bags","_normalMags","_normalWeaps","_normalBags","_kinds","_amounts","_counter","_kinds2","_amounts2"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
Z_vehicle = objNull;
|
Z_vehicle = objNull;
|
||||||
call Z_clearLists;
|
call Z_clearLists;
|
||||||
Z_SellableArray = [];
|
Z_SellableArray = [];
|
||||||
@@ -16,7 +18,7 @@ _list = nearestObjects [_pos, ["Air","LandVehicle","Ship"], Z_VehicleDistance];
|
|||||||
if (!isNull _x && local _x && alive _x) then {
|
if (!isNull _x && local _x && alive _x) then {
|
||||||
_vehicle = _x;
|
_vehicle = _x;
|
||||||
};
|
};
|
||||||
}count _list;
|
} count _list;
|
||||||
|
|
||||||
if (!isNull _vehicle) then {
|
if (!isNull _vehicle) then {
|
||||||
systemChat format[localize "STR_EPOCH_TRADE_SELECTED",typeOf _vehicle];
|
systemChat format[localize "STR_EPOCH_TRADE_SELECTED",typeOf _vehicle];
|
||||||
@@ -38,43 +40,37 @@ if (!isNull _vehicle) then {
|
|||||||
_normalBags = [];
|
_normalBags = [];
|
||||||
|
|
||||||
_kinds = _mags select 0;
|
_kinds = _mags select 0;
|
||||||
_ammmounts = _mags select 1;
|
_amounts = _mags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts select _forEachIndex)}do{
|
while {_counter < (_amounts select _forEachIndex)} do {
|
||||||
_normalMags set [count(_normalMags),_x];
|
_normalMags set [count(_normalMags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds;
|
} forEach _kinds;
|
||||||
|
|
||||||
_kinds2 = _weaps select 0;
|
_kinds2 = _weaps select 0;
|
||||||
_ammmounts2 = _weaps select 1;
|
_amounts2 = _weaps select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts2 select _forEachIndex)}do{
|
while {_counter < (_amounts2 select _forEachIndex)} do {
|
||||||
_normalWeaps set [count(_normalWeaps),_x];
|
_normalWeaps set [count(_normalWeaps),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds2;
|
} forEach _kinds2;
|
||||||
|
|
||||||
// Can't sell backpacks from vehicle because there is currently no command to remove single backpacks from cargo (only clearBackpackCargo which removes all)
|
// Can't sell backpacks from vehicle because there is currently no command to remove single backpacks from cargo (only clearBackpackCargo which removes all)
|
||||||
/*
|
/*
|
||||||
_kinds3 = _bags select 0;
|
_kinds3 = _bags select 0;
|
||||||
_ammmounts3 = _bags select 1;
|
_amounts3 = _bags select 1;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _ammmounts3 select _forEachIndex)}do{
|
while {_counter < (_amounts3 select _forEachIndex)} do {
|
||||||
_normalBags set [count(_normalBags),_x];
|
_normalBags set [count(_normalBags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _kinds3;
|
} forEach _kinds3;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[_normalWeaps,_normalMags, typeOf _vehicle,_normalBags] call Z_checkArrayInConfig;
|
[_normalWeaps,_normalMags, typeOf _vehicle,_normalBags] call Z_checkArrayInConfig;
|
||||||
}else{
|
|
||||||
_ctrltext = localize "STR_EPOCH_PLAYER_245";
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE2, _ctrltext];
|
|
||||||
|
|
||||||
_ctrltext = localize "STR_EPOCH_TRADE_NO_VEHICLE";
|
|
||||||
ctrlSetText [Z_AT_TRADERLINE1, _ctrltext];
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
private ["_Z_logTrade","_classNames","_className","_amounts","_amount","_prices","_price","_quantity","_queueAmounts","_queueNames","_queuePrices","_index","_buyOrSell"];
|
private ["_Z_logTrade","_classNames","_className","_amounts","_amount","_prices","_price","_quantity","_queueAmounts","_queueNames","_queuePrices","_index","_buyOrSell"];
|
||||||
|
|
||||||
_Z_logTrade = {
|
_Z_logTrade = {
|
||||||
private ["_buyOrSell","_className","_container","_currency","_price","_quantity"];
|
private ["_buyOrSell","_className","_container","_currency","_price","_quantity","_tCost"];
|
||||||
|
|
||||||
_className = _this select 0;
|
_className = _this select 0;
|
||||||
_quantity = _this select 1;
|
_quantity = _this select 1;
|
||||||
@@ -12,7 +12,7 @@ _Z_logTrade = {
|
|||||||
case 1 : {localize "STR_EPOCH_TRADE_VEHICLE"};
|
case 1 : {localize "STR_EPOCH_TRADE_VEHICLE"};
|
||||||
case 2 : {localize "STR_UI_GEAR"};
|
case 2 : {localize "STR_UI_GEAR"};
|
||||||
};
|
};
|
||||||
_tcost = _price call Z_calcDefaultCurrencyNoImg;
|
_tCost = _price call Z_calcDefaultCurrencyNoImg;
|
||||||
_currency = if (Z_SingleCurrency) then {"Coins"} else {""};
|
_currency = if (Z_SingleCurrency) then {"Coins"} else {""};
|
||||||
|
|
||||||
// Log to client RPT
|
// Log to client RPT
|
||||||
@@ -24,9 +24,9 @@ _Z_logTrade = {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (_buyOrSell == "buy") then {
|
if (_buyOrSell == "buy") then {
|
||||||
diag_log format["%5: Bought %4 x %1 into %7 at %2 for %3",_className,inTraderCity,_tcost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
|
diag_log format["%5: Bought %4 x %1 into %7 at %2 for %3",_className,inTraderCity,_tCost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
|
||||||
} else {
|
} else {
|
||||||
diag_log format["%5: Sold %4 x %1 from %7 at %2 for %3",_className,inTraderCity,_tcost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
|
diag_log format["%5: Sold %4 x %1 from %7 at %2 for %3",_className,inTraderCity,_tCost,_quantity,localize "STR_EPOCH_PLAYER_289",_currency,_container];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -40,9 +40,9 @@ _Z_logTrade = {
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
if (_buyOrSell == "buy") then {
|
if (_buyOrSell == "buy") then {
|
||||||
PVDZE_obj_Trade = [player,0,0,_className,inTraderCity,_currency,_tcost,_quantity,_container,false];
|
PVDZE_obj_Trade = [player,0,0,_className,inTraderCity,_currency,_tCost,_quantity,_container,false];
|
||||||
} else {
|
} else {
|
||||||
PVDZE_obj_Trade = [player,0,1,_className,inTraderCity,_currency,_tcost,_quantity,_container,false];
|
PVDZE_obj_Trade = [player,0,1,_className,inTraderCity,_currency,_tCost,_quantity,_container,false];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
publicVariableServer "PVDZE_obj_Trade";
|
publicVariableServer "PVDZE_obj_Trade";
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ _moneyInVehicle = _moneyInfo select 3;
|
|||||||
|
|
||||||
{
|
{
|
||||||
_nil = [player, _x , 1] call BIS_fnc_invRemove;
|
_nil = [player, _x , 1] call BIS_fnc_invRemove;
|
||||||
}count _moneyInGear;
|
} count _moneyInGear;
|
||||||
|
|
||||||
if (count _moneyInBackpack > 0 ) then {
|
if (count _moneyInBackpack > 0) then {
|
||||||
_nil = [unitBackpack _player, _moneyInBackpack, []] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
_nil = [unitBackpack _player, _moneyInBackpack, []] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
||||||
};
|
};
|
||||||
if (!isNull Z_vehicle && count _moneyInVehicle > 0 ) then {
|
if (!isNull Z_vehicle && count _moneyInVehicle > 0) then {
|
||||||
_nil = [Z_vehicle, _moneyInVehicle, []] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
_nil = [Z_vehicle, _moneyInVehicle, []] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
private ["_index","_temp","_index2"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if (!isNil"_index" && _index > -1) then {
|
||||||
lbDelete [Z_AT_SELLABLELIST, _index];
|
lbDelete [Z_AT_SELLABLELIST, _index];
|
||||||
_temp = Z_SellableArray select _index;
|
_temp = Z_SellableArray select _index;
|
||||||
//_item = [_temp select 0,_temp select 1 ,_temp select 2,_temp select 3, _temp select 4 ];
|
//_item = [_temp select 0,_temp select 1 ,_temp select 2,_temp select 3, _temp select 4 ];
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
private "_index";
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if (!isNil"_index" && _index > -1) then {
|
||||||
lbDelete [Z_AT_BUYINGLIST, _index];
|
lbDelete [Z_AT_BUYINGLIST, _index];
|
||||||
Z_BuyingArray set [_index,"deleted"];
|
Z_BuyingArray set [_index,"deleted"];
|
||||||
Z_BuyingArray = Z_BuyingArray - ["deleted"];
|
Z_BuyingArray = Z_BuyingArray - ["deleted"];
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
private ["_index","_temp","_index2"];
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_index = _this select 0;
|
_index = _this select 0;
|
||||||
if(!isNil"_index" && _index > -1)then {
|
if (!isNil"_index" && _index > -1) then {
|
||||||
lbDelete [Z_AT_SELLINGLIST, _index];
|
lbDelete [Z_AT_SELLINGLIST, _index];
|
||||||
_temp = Z_SellArray select _index;
|
_temp = Z_SellArray select _index;
|
||||||
//_item = [_temp select 0,_temp select 1 ,_temp select 2,_temp select 3, _temp select 4 ];
|
//_item = [_temp select 0,_temp select 1 ,_temp select 2,_temp select 3, _temp select 4 ];
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ _sellVehicle = {
|
|||||||
if (!(_sellType in ["trade_any_boat", "trade_any_boat_old"])) then {
|
if (!(_sellType in ["trade_any_boat", "trade_any_boat_old"])) then {
|
||||||
_hitpoints = _obj call vehicle_getHitpoints;
|
_hitpoints = _obj call vehicle_getHitpoints;
|
||||||
{
|
{
|
||||||
if(["Wheel",_x,false] call fnc_inString) then {
|
if (["Wheel",_x,false] call fnc_inString) then {
|
||||||
_damage = [_obj,_x] call object_getHit;
|
_damage = [_obj,_x] call object_getHit;
|
||||||
_tireDmg = _tireDmg + _damage;
|
_tireDmg = _tireDmg + _damage;
|
||||||
_tires = _tires + 1;
|
_tires = _tires + 1;
|
||||||
};
|
};
|
||||||
} forEach _hitpoints;
|
} forEach _hitpoints;
|
||||||
if(_tireDmg > 0 && _tires > 0) then {
|
if (_tireDmg > 0 && _tires > 0) then {
|
||||||
if((_tireDmg / _tires) > 0.75) then {
|
if ((_tireDmg / _tires) > 0.75) then {
|
||||||
_okToSell = false;
|
_okToSell = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -52,14 +52,16 @@ _sellVehicle = {
|
|||||||
_objectCharacterId = _obj getVariable ["CharacterID","0"];
|
_objectCharacterId = _obj getVariable ["CharacterID","0"];
|
||||||
_notSetup = (_objectID == "0" && _objectUID == "0");
|
_notSetup = (_objectID == "0" && _objectUID == "0");
|
||||||
|
|
||||||
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
|
if (local _obj && !isNull _obj && alive _obj && !_notSetup) then {
|
||||||
if(_okToSell) then {
|
if (_okToSell) then {
|
||||||
_returnInfo = [_objectCharacterId, _obj, _objectID, _objectUID, _sellType];
|
_returnInfo = [_objectCharacterId, _obj, _objectID, _objectUID, _sellType];
|
||||||
} else {
|
} else {
|
||||||
systemChat format[localize "str_epoch_player_182",typeOf _obj]; _returnInfo = [];
|
systemChat format[localize "str_epoch_player_182",typeOf _obj];
|
||||||
|
_returnInfo = [];
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
systemChat localize "str_epoch_player_245"; _returnInfo = [];
|
systemChat localize "str_epoch_player_245";
|
||||||
|
_returnInfo = [];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
_returnInfo;
|
_returnInfo;
|
||||||
@@ -99,7 +101,7 @@ _sellVehicle = {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}forEach Z_SellArray;
|
} forEach Z_SellArray;
|
||||||
|
|
||||||
_tSold = _itemsArray + _weaponsArray + _bpArray + _vehArray;
|
_tSold = _itemsArray + _weaponsArray + _bpArray + _vehArray;
|
||||||
|
|
||||||
@@ -115,7 +117,7 @@ if (Z_SellingFrom == 1) then {
|
|||||||
_itemsToLog set [0,(_itemsArray + _weaponsArray + _bpArray + [typeOf Z_vehicle])];
|
_itemsToLog set [0,(_itemsArray + _weaponsArray + _bpArray + [typeOf Z_vehicle])];
|
||||||
|
|
||||||
//gear
|
//gear
|
||||||
if (Z_SellingFrom == 2)then{
|
if (Z_SellingFrom == 2) then {
|
||||||
private ["_localResult", "_vehTraded"];
|
private ["_localResult", "_vehTraded"];
|
||||||
_wA = [];
|
_wA = [];
|
||||||
_mA = [];
|
_mA = [];
|
||||||
@@ -139,23 +141,23 @@ if (Z_SellingFrom == 2)then{
|
|||||||
if (_type == "trade_items") then {_name = configFile >> "CfgMagazines" >> _name;};
|
if (_type == "trade_items") then {_name = configFile >> "CfgMagazines" >> _name;};
|
||||||
if (_type == "trade_weapons") then {_name = configFile >> "CfgWeapons" >> _name;};
|
if (_type == "trade_weapons") then {_name = configFile >> "CfgWeapons" >> _name;};
|
||||||
_localResult = [player,_name,1] call BIS_fnc_invRemove; // Use config for BIS_fnc_invRemove
|
_localResult = [player,_name,1] call BIS_fnc_invRemove; // Use config for BIS_fnc_invRemove
|
||||||
if(_localResult != 1)then{
|
if (_localResult != 1) then {
|
||||||
if(_x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
_mA set [count(_mA),0];
|
_mA set [count(_mA),0];
|
||||||
}else{
|
} else {
|
||||||
_wA set [count(_wA),0];
|
_wA set [count(_wA),0];
|
||||||
};
|
};
|
||||||
}else{
|
} else {
|
||||||
if(_x select 1 == "trade_items")then{
|
if (_x select 1 == "trade_items") then {
|
||||||
_mA set [count(_mA),1];
|
_mA set [count(_mA),1];
|
||||||
}else{
|
} else {
|
||||||
_wA set [count(_wA),1];
|
_wA set [count(_wA),1];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}forEach Z_SellArray;
|
} forEach Z_SellArray;
|
||||||
|
|
||||||
_outcome set [0,_mA];
|
_outcome set [0,_mA];
|
||||||
_outcome set [1,_wA];
|
_outcome set [1,_wA];
|
||||||
@@ -169,22 +171,22 @@ if (Z_SellingFrom == 2)then{
|
|||||||
systemchat format[localize "STR_EPOCH_TRADE_SELL_IN_GEAR",count _tSold];
|
systemchat format[localize "STR_EPOCH_TRADE_SELL_IN_GEAR",count _tSold];
|
||||||
};
|
};
|
||||||
|
|
||||||
{ _itemsToLog set [1, (_itemsToLog select 1) + _x] } forEach _outcome;
|
{_itemsToLog set [1, (_itemsToLog select 1) + _x]} forEach _outcome;
|
||||||
_money = 0;
|
_money = 0;
|
||||||
|
|
||||||
if (Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
{
|
{
|
||||||
_money = _money + ( (((_itemsCheckArray select _forEachIndex) select 0)) * _x) ;
|
_money = _money + ((((_itemsCheckArray select _forEachIndex) select 0)) * _x) ;
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (((_itemsCheckArray select _forEachIndex) select 0)) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((((_itemsCheckArray select _forEachIndex) select 0)) * _x)]];
|
||||||
}forEach (_outcome select 0);
|
} forEach (_outcome select 0);
|
||||||
{
|
{
|
||||||
_money = _money + ( (((_weaponsCheckArray select _forEachIndex) select 0)) * _x) ;
|
_money = _money + ((((_weaponsCheckArray select _forEachIndex) select 0)) * _x) ;
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (((_weaponsCheckArray select _forEachIndex) select 0)) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((((_weaponsCheckArray select _forEachIndex) select 0)) * _x)]];
|
||||||
}forEach (_outcome select 1);
|
} forEach (_outcome select 1);
|
||||||
{
|
{
|
||||||
_money = _money + ( ( ((_bpCheckArray select _forEachIndex) select 0) ) * _x) ;
|
_money = _money + ((((_bpCheckArray select _forEachIndex) select 0)) * _x) ;
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (((_bpCheckArray select _forEachIndex) select 0)) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((((_bpCheckArray select _forEachIndex) select 0)) * _x)]];
|
||||||
}forEach (_outcome select 2);
|
} forEach (_outcome select 2);
|
||||||
|
|
||||||
if (count _outcome > 3) then {
|
if (count _outcome > 3) then {
|
||||||
_money = _money + ((_vehCheckArray select 0) select 0);
|
_money = _money + ((_vehCheckArray select 0) select 0);
|
||||||
@@ -193,19 +195,19 @@ if (Z_SingleCurrency) then {
|
|||||||
} else {
|
} else {
|
||||||
{
|
{
|
||||||
_itemData = _itemsCheckArray select _forEachIndex;
|
_itemData = _itemsCheckArray select _forEachIndex;
|
||||||
_money = _money + ( (_itemData select 0) * (_itemData select 1) * _x);
|
_money = _money + ((_itemData select 0) * (_itemData select 1) * _x);
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (_itemData select 0) * (_itemData select 1) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((_itemData select 0) * (_itemData select 1) * _x)]];
|
||||||
}forEach (_outcome select 0);
|
} forEach (_outcome select 0);
|
||||||
{
|
{
|
||||||
_itemData = _weaponsCheckArray select _forEachIndex;
|
_itemData = _weaponsCheckArray select _forEachIndex;
|
||||||
_money = _money + ( (_itemData select 0) * (_itemData select 1) * _x);
|
_money = _money + ((_itemData select 0) * (_itemData select 1) * _x);
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (_itemData select 0) * (_itemData select 1) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((_itemData select 0) * (_itemData select 1) * _x)]];
|
||||||
}forEach (_outcome select 1);
|
} forEach (_outcome select 1);
|
||||||
{
|
{
|
||||||
_itemData = _bpCheckArray select _forEachIndex;
|
_itemData = _bpCheckArray select _forEachIndex;
|
||||||
_money = _money + ( (_itemData select 0) * (_itemData select 1) * _x);
|
_money = _money + ((_itemData select 0) * (_itemData select 1) * _x);
|
||||||
_itemsToLog set [2, (_itemsToLog select 2) + [( (_itemData select 0) * (_itemData select 1) * _x)]];
|
_itemsToLog set [2, (_itemsToLog select 2) + [((_itemData select 0) * (_itemData select 1) * _x)]];
|
||||||
}forEach (_outcome select 2);
|
} forEach (_outcome select 2);
|
||||||
if ((count _outcome) > 3) then {
|
if ((count _outcome) > 3) then {
|
||||||
_itemData = _vehCheckArray select 0;
|
_itemData = _vehCheckArray select 0;
|
||||||
_money = _money + ((_itemData select 0) * (_itemData select 1));
|
_money = _money + ((_itemData select 0) * (_itemData select 1));
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
private ["_amount","_index","_index2","_temp"];
|
private ["_amount","_index","_index2","_temp"];
|
||||||
|
|
||||||
#include "defines.hpp"
|
#include "defines.hpp"
|
||||||
|
|
||||||
_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") && _amount > 0) 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];
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* ----------------------------------------------------------------------------
|
/* ----------------------------------------------------------------------------
|
||||||
Examples:
|
Examples:
|
||||||
_result = [_backpack, ["SmokeShell","M16_AMMO"],["M16","M16","M240"],["backpack1","backpack2"]] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
_result = [_backpack, ["SmokeShell","M16_AMMO"],["M16","M16","M240"],["backpack1","backpack2"]] call ZUPA_fnc_removeWeaponsAndMagazinesCargo;
|
||||||
_result == [[1,0,0,1,1,1,0],[1,0,0,1],[1,0]]; // 1 = success, 0 = fail ->( item was not in cargo)
|
_result == [[1,0,0,1,1,1,0],[1,0,0,1],[1,0]]; // 1 = success, 0 = fail ->(item was not in cargo)
|
||||||
|
|
||||||
Author:
|
Author:
|
||||||
Zupa 2014-09-30
|
Zupa 2014-09-30
|
||||||
@@ -14,7 +14,7 @@ _weaps = _this select 2;
|
|||||||
_bags = [];
|
_bags = [];
|
||||||
_vehInfo = [];
|
_vehInfo = [];
|
||||||
|
|
||||||
if(count _this > 3) then {
|
if (count _this > 3) then {
|
||||||
if (count (_this select 3) > 0) then {
|
if (count (_this select 3) > 0) then {
|
||||||
if (typeName ((_this select 3) select 0) == "STRING") then {
|
if (typeName ((_this select 3) select 0) == "STRING") then {
|
||||||
_bags = _this select 3;
|
_bags = _this select 3;
|
||||||
@@ -46,31 +46,31 @@ _unit_allBags_count = _unit_allBags select 1;
|
|||||||
clearMagazineCargoGlobal _unit;
|
clearMagazineCargoGlobal _unit;
|
||||||
clearWeaponCargoGlobal _unit;
|
clearWeaponCargoGlobal _unit;
|
||||||
|
|
||||||
if( count _bags > 0 )then{
|
if (count _bags > 0) then {
|
||||||
clearBackpackCargoGlobal _unit;
|
clearBackpackCargoGlobal _unit;
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _unit_allItems_count select _forEachIndex)}do{
|
while {_counter < (_unit_allItems_count select _forEachIndex)} do {
|
||||||
_normalItems set [count(_normalItems),_x];
|
_normalItems set [count(_normalItems),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _unit_allItems_types;
|
} forEach _unit_allItems_types;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _unit_allWeaps_count select _forEachIndex)}do{
|
while {_counter < (_unit_allWeaps_count select _forEachIndex)} do {
|
||||||
_normalWeaps set [count(_normalWeaps),_x];
|
_normalWeaps set [count(_normalWeaps),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _unit_allWeaps_types;
|
} forEach _unit_allWeaps_types;
|
||||||
{
|
{
|
||||||
_counter = 0 ;
|
_counter = 0 ;
|
||||||
while{ _counter < ( _unit_allBags_count select _forEachIndex)}do{
|
while {_counter < (_unit_allBags_count select _forEachIndex)} do {
|
||||||
_normalBagss set [count(_normalBags),_x];
|
_normalBagss set [count(_normalBags),_x];
|
||||||
_counter = _counter + 1;
|
_counter = _counter + 1;
|
||||||
};
|
};
|
||||||
}forEach _unit_allBags_types;
|
} forEach _unit_allBags_types;
|
||||||
|
|
||||||
_returnVar = [];
|
_returnVar = [];
|
||||||
_returnMag = [];
|
_returnMag = [];
|
||||||
@@ -78,45 +78,45 @@ _returnWeap = [];
|
|||||||
_returnBag = [];
|
_returnBag = [];
|
||||||
{
|
{
|
||||||
_inCargo = _normalItems find _x;
|
_inCargo = _normalItems find _x;
|
||||||
if(_inCargo > -1)then{
|
if (_inCargo > -1) then {
|
||||||
_normalItems set [_inCargo, "soldItem"];
|
_normalItems set [_inCargo, "soldItem"];
|
||||||
_returnMag set [count(_returnMag),1];
|
_returnMag set [count(_returnMag),1];
|
||||||
}else{
|
} else {
|
||||||
_returnMag set [count(_returnMag),0];
|
_returnMag set [count(_returnMag),0];
|
||||||
};
|
};
|
||||||
}count _items;
|
} count _items;
|
||||||
_normalItems = _normalItems - ["soldItem"];
|
_normalItems = _normalItems - ["soldItem"];
|
||||||
{
|
{
|
||||||
_unit addMagazineCargoGlobal [_x, 1];
|
_unit addMagazineCargoGlobal [_x, 1];
|
||||||
}count _normalItems;
|
} count _normalItems;
|
||||||
|
|
||||||
{
|
{
|
||||||
_inCargo = _normalBags find _x;
|
_inCargo = _normalBags find _x;
|
||||||
if(_inCargo > -1)then{
|
if (_inCargo > -1) then {
|
||||||
_normalBags set [_inCargo, "soldItem"];
|
_normalBags set [_inCargo, "soldItem"];
|
||||||
_returnBag set [count(_returnBag),1];
|
_returnBag set [count(_returnBag),1];
|
||||||
}else{
|
} else {
|
||||||
_returnBag set [count(_returnBag),0];
|
_returnBag set [count(_returnBag),0];
|
||||||
};
|
};
|
||||||
}count _bags;
|
} count _bags;
|
||||||
{
|
{
|
||||||
_unit addBackpackCargoGlobal [_x, 1];
|
_unit addBackpackCargoGlobal [_x, 1];
|
||||||
}count _normalBags;
|
} count _normalBags;
|
||||||
|
|
||||||
{
|
{
|
||||||
_inCargo = _normalWeaps find _x;
|
_inCargo = _normalWeaps find _x;
|
||||||
if(_inCargo > -1)then{
|
if (_inCargo > -1) then {
|
||||||
_normalWeaps set [_inCargo, "soldItem"];
|
_normalWeaps set [_inCargo, "soldItem"];
|
||||||
_returnWeap set [count(_returnWeap),1];
|
_returnWeap set [count(_returnWeap),1];
|
||||||
}else{
|
} else {
|
||||||
_returnWeap set [count(_returnWeap),0];
|
_returnWeap set [count(_returnWeap),0];
|
||||||
};
|
};
|
||||||
}count _weaps;
|
} count _weaps;
|
||||||
|
|
||||||
_normalWeaps = _normalWeaps - ["soldItem"];
|
_normalWeaps = _normalWeaps - ["soldItem"];
|
||||||
{
|
{
|
||||||
_unit addWeaponCargoGlobal [_x, 1];
|
_unit addWeaponCargoGlobal [_x, 1];
|
||||||
}count _normalWeaps;
|
} count _normalWeaps;
|
||||||
_normalWeaps = _normalWeaps - ["soldItem"];
|
_normalWeaps = _normalWeaps - ["soldItem"];
|
||||||
|
|
||||||
if (count _vehInfo > 0) then {
|
if (count _vehInfo > 0) then {
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ disableSerialization;
|
|||||||
|
|
||||||
Z_traderData = (_this select 3); // gets the trader data ( e.g menu_Functionary1 )
|
Z_traderData = (_this select 3); // gets the trader data ( e.g menu_Functionary1 )
|
||||||
|
|
||||||
if( isNil "Z_traderData" || count (Z_traderData) == 0)exitWith{
|
if (isNil "Z_traderData" || count (Z_traderData) == 0) exitWith {
|
||||||
localize "STR_EPOCH_TRADE_ERROR" call dayz_rollingMessages;
|
localize "STR_EPOCH_TRADE_ERROR" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(DZE_ActionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
if (DZE_ActionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
|
||||||
|
|
||||||
if(isNil "Z_AdvancedTradingInit")then{
|
if (isNil "Z_AdvancedTradingInit") then {
|
||||||
|
|
||||||
//#include "config.sqf"; // Moved to dayz_code/configVariables.sqf
|
//#include "config.sqf"; // Moved to dayz_code/configVariables.sqf
|
||||||
#include "\z\addons\dayz_code\actions\AdvancedTrading\functions\defines.hpp"
|
#include "\z\addons\dayz_code\actions\AdvancedTrading\functions\defines.hpp"
|
||||||
@@ -34,7 +34,6 @@ if(isNil "Z_AdvancedTradingInit")then{
|
|||||||
DZE_GemWorthList set [(count DZE_GemWorthList), _largest];
|
DZE_GemWorthList set [(count DZE_GemWorthList), _largest];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Z_Selling = true;
|
Z_Selling = true;
|
||||||
Z_SellingFrom = 2;
|
Z_SellingFrom = 2;
|
||||||
Z_vehicle = objNull;
|
Z_vehicle = objNull;
|
||||||
@@ -45,7 +44,7 @@ if(isNil "Z_AdvancedTradingInit")then{
|
|||||||
Z_BuyableArray = [];
|
Z_BuyableArray = [];
|
||||||
Z_BuyingArray = [];
|
Z_BuyingArray = [];
|
||||||
|
|
||||||
if( isNil 'CurrencyName' && Z_SingleCurrency )then{
|
if (isNil 'CurrencyName' && Z_SingleCurrency) then {
|
||||||
CurrencyName = 'Coins'; // fallback
|
CurrencyName = 'Coins'; // fallback
|
||||||
};
|
};
|
||||||
if (!Z_SingleCurrency) then {
|
if (!Z_SingleCurrency) then {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_pos","_plots","_inList"];
|
private ["_pos","_plots","_inList","_friends","_toAdd"];
|
||||||
|
|
||||||
_pos = _this select 0;
|
_pos = _this select 0;
|
||||||
if (_pos < 0) exitWith {};
|
if (_pos < 0) exitWith {};
|
||||||
_toAdd = (Humans select _pos);
|
_toAdd = (Humans select _pos);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_plots","_friendlies","_thePlot"];
|
private ["_friends"];
|
||||||
|
|
||||||
lbClear 7102;
|
lbClear 7102;
|
||||||
_friends = TheDoor getVariable ["doorfriends",[]];
|
_friends = TheDoor getVariable ["doorfriends",[]];
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_close"];
|
private ["_closePeople","_friendUID","_friendName"];
|
||||||
|
|
||||||
lbClear 7101;
|
lbClear 7101;
|
||||||
_closePeople = player nearEntities ["CAManBase", 10];
|
_closePeople = player nearEntities ["CAManBase", 10];
|
||||||
if (!DZE_doorManagementMustBeClose) then {_closePeople = playableUnits};
|
if (!DZE_doorManagementMustBeClose) then {_closePeople = playableUnits};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_list","_plots","_thePlot","_friends"];
|
private ["_pos","_friends","_toRemove","_newList"];
|
||||||
|
|
||||||
_pos = _this select 0;
|
_pos = _this select 0;
|
||||||
if (_pos < 0) exitWith {};
|
if (_pos < 0) exitWith {};
|
||||||
_friends = TheDoor getVariable ["doorfriends", []];
|
_friends = TheDoor getVariable ["doorfriends", []];
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
|
private ["_display","isOwner"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
if(count(_this) > 0) then
|
|
||||||
|
if (count(_this) > 0) then
|
||||||
{
|
{
|
||||||
TheDoor = _this select 3;
|
TheDoor = _this select 3;
|
||||||
} else {
|
} else {
|
||||||
@@ -11,14 +13,14 @@ _display = findDisplay 61144;
|
|||||||
_display closeDisplay 3000;
|
_display closeDisplay 3000;
|
||||||
|
|
||||||
// Check player access
|
// Check player access
|
||||||
_isowner = [player, TheDoor] call FNC_check_access;
|
_isOwner = [player, TheDoor] call FNC_check_access;
|
||||||
if( ((_isowner select 0) && DZE_doorManagementAllowManage_owner) // door owner
|
if( ((_isOwner select 0) && DZE_doorManagementAllowManage_owner) // door owner
|
||||||
|| ((_isowner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged
|
|| ((_isOwner select 1) && DZE_doorManagementAllowManage_ownerFriendlies) // door owner's friendly tagged
|
||||||
|| ((_isowner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner
|
|| ((_isOwner select 2) && DZE_doorManagementAllowManage_plotOwner) // plot owner
|
||||||
|| ((_isowner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends
|
|| ((_isOwner select 3) && DZE_doorManagementAllowManage_plotFriends) // plot friends
|
||||||
|| ((_isowner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins
|
|| ((_isOwner select 4) && DZE_doorManagementAllowManage_plotAdmins) // plot management admins
|
||||||
|| ((_isowner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends
|
|| ((_isOwner select 5) && DZE_doorManagementAllowManage_doorFriends) // door friends
|
||||||
|| ((_isowner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins
|
|| ((_isOwner select 6) && DZE_doorManagementAllowManage_doorAdmins) // door management admins
|
||||||
) then {
|
) then {
|
||||||
createDialog "DoorManagement";
|
createDialog "DoorManagement";
|
||||||
call DoorNearbyHumans;
|
call DoorNearbyHumans;
|
||||||
@@ -26,4 +28,3 @@ if( ((_isowner select 0) && DZE_doorManagementAllowManage_owner) // door owner
|
|||||||
} else {
|
} else {
|
||||||
localize "STR_EPOCH_DOORMANAGEMENT_NORIGHTS" call dayz_rollingMessages;
|
localize "STR_EPOCH_DOORMANAGEMENT_NORIGHTS" call dayz_rollingMessages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
private "_display";
|
||||||
|
|
||||||
// Close DoorAccess
|
// Close DoorAccess
|
||||||
_display = findDisplay 61144;
|
_display = findDisplay 61144;
|
||||||
_display closeDisplay 3000;
|
_display closeDisplay 3000;
|
||||||
if(DZE_doorManagementAllowManualCode) then {
|
if (DZE_doorManagementAllowManualCode) then {
|
||||||
//DZE_Lock_Door != (this getvariable['CharacterID','0']);
|
//DZE_Lock_Door != (this getvariable['CharacterID','0']);
|
||||||
DZE_topCombo = 0;
|
DZE_topCombo = 0;
|
||||||
DZE_midCombo = 0;
|
DZE_midCombo = 0;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_pos","_plots","_thePlot","_inList"];
|
private ["_pos","_plots","_thePlot","_inList","_toAdd","_friends"];
|
||||||
|
|
||||||
_pos = _this select 0;
|
_pos = _this select 0;
|
||||||
if (_pos < 0) exitWith {};
|
if (_pos < 0) exitWith {};
|
||||||
_toAdd = (Humans select _pos);
|
_toAdd = (Humans select _pos);
|
||||||
@@ -18,6 +19,5 @@ if (isServer) then {
|
|||||||
publicVariableServer "PVDZ_veh_Save";
|
publicVariableServer "PVDZ_veh_Save";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
call PlotGetFriends;
|
call PlotGetFriends;
|
||||||
call PlotNearbyHumans;
|
call PlotNearbyHumans;
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_plots","_friendlies","_thePlot"];
|
private ["_plots","_friendlies","_thePlot"];
|
||||||
|
|
||||||
lbClear 7002;
|
lbClear 7002;
|
||||||
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
|
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
|
||||||
_thePlot = _plots select 0;
|
_thePlot = _plots select 0;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_closePeople","_friendUID","_friendName"];
|
private ["_closePeople","_friendUID","_friendName"];
|
||||||
|
|
||||||
lbClear 7001;
|
lbClear 7001;
|
||||||
if (!DZE_plotManagementMustBeClose) then {_closePeople = playableUnits;} else {_closePeople = player nearEntities ["CAManBase", 10];};
|
if (!DZE_plotManagementMustBeClose) then {_closePeople = playableUnits;} else {_closePeople = player nearEntities ["CAManBase", 10];};
|
||||||
Humans = [];
|
Humans = [];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
private ["_newWealth","_missing","_missingQty","_proceed","_itemIn","_countIn","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_option","_buildables"];
|
private ["_range","_buildables","_count","_colour","_result","_ctrl"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
_range = DZE_PlotPole select 0;
|
_range = DZE_PlotPole select 0;
|
||||||
@@ -7,11 +7,11 @@ _count = count (nearestObjects [[player] call FNC_getPos,_buildables,_range]);
|
|||||||
|
|
||||||
_colour = "#ffffff";
|
_colour = "#ffffff";
|
||||||
|
|
||||||
if(_count / DZE_BuildingLimit * 100 < 40)then{
|
if (_count / DZE_BuildingLimit * 100 < 40) then {
|
||||||
_colour = "#00ff00";
|
_colour = "#00ff00";
|
||||||
};
|
};
|
||||||
if(_count / DZE_BuildingLimit * 100 > 75)then{
|
if (_count / DZE_BuildingLimit * 100 > 75) then {
|
||||||
_colour = "#ff0000";
|
_colour = "#ff0000";
|
||||||
};
|
};
|
||||||
|
|
||||||
_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7014);
|
_ctrl = ((uiNamespace getVariable "PlotManagement") displayCtrl 7014);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
private ["_pos","_plots","_thePlot","_friends","_toRemove","_newList"];
|
private ["_pos","_plots","_thePlot","_friends","_toRemove","_newList"];
|
||||||
|
|
||||||
_pos = _this select 0;
|
_pos = _this select 0;
|
||||||
if (_pos < 0) exitWith {};
|
if (_pos < 0) exitWith {};
|
||||||
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
|
_plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];
|
||||||
@@ -7,7 +8,7 @@ _friends = _thePlot getVariable ["plotfriends", []];
|
|||||||
_toRemove = (_friends select _pos);
|
_toRemove = (_friends select _pos);
|
||||||
_newList = [];
|
_newList = [];
|
||||||
{
|
{
|
||||||
if(_x select 0 != _toRemove select 0)then{
|
if(_x select 0 != _toRemove select 0) then {
|
||||||
_newList set [(count _newList), _x];
|
_newList set [(count _newList), _x];
|
||||||
};
|
};
|
||||||
} count _friends;
|
} count _friends;
|
||||||
|
|||||||
@@ -51,7 +51,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_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_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_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
|
DZE_SaleRequiresKey = false; //Require the player has the key for a vehicle in order 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_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_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.
|
Z_SingleCurrency = false; // Does your server use a single currency system.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ feature.
|
|||||||
* [DDesmond] (https://github.com/ddesmond)
|
* [DDesmond] (https://github.com/ddesmond)
|
||||||
* [Sharkiller](https://github.com/Sharkiller) (Spanish Tranlations)
|
* [Sharkiller](https://github.com/Sharkiller) (Spanish Tranlations)
|
||||||
* [Defwen](https://github.com/Defwen) (Czech Translations)
|
* [Defwen](https://github.com/Defwen) (Czech Translations)
|
||||||
* [[VB]AWOL](https://github.com/vbawol)
|
* [[VB]AWOL](https://github.com/vbawol)
|
||||||
* [Paul Tomany](https://github.com/Sequisha)
|
* [Paul Tomany](https://github.com/Sequisha)
|
||||||
* [M1lkM8n](https://github.com/M1lkm8n)
|
* [M1lkM8n](https://github.com/M1lkm8n)
|
||||||
* [JST](https://github.com/Cybersam248)
|
* [JST](https://github.com/Cybersam248)
|
||||||
|
|||||||
@@ -13162,7 +13162,7 @@
|
|||||||
<Czech>Vytvořit Dřevěnou ohradu</Czech>
|
<Czech>Vytvořit Dřevěnou ohradu</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_PLAYER_245">
|
<Key ID="STR_EPOCH_PLAYER_245">
|
||||||
<English>Failed, you must get into drivers seat first.</English>
|
<English>You must get into the drivers seat of a vehicle first.</English>
|
||||||
<German>Fehlgeschlagen, Sie müssen zuerst auf den Fahrersitz.</German>
|
<German>Fehlgeschlagen, Sie müssen zuerst auf den Fahrersitz.</German>
|
||||||
<Russian>Вы должны попасть на сиденье водителя хотя бы раз.</Russian>
|
<Russian>Вы должны попасть на сиденье водителя хотя бы раз.</Russian>
|
||||||
<!-- <Spanish></Spanish> -->
|
<!-- <Spanish></Spanish> -->
|
||||||
@@ -16062,28 +16062,28 @@
|
|||||||
<Czech>Prodejní</Czech>
|
<Czech>Prodejní</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_SELLING_GEAR">
|
<Key ID="STR_EPOCH_TRADE_SELLING_GEAR">
|
||||||
<English>Selling from gear.</English>
|
<English>Selling from your gear.</English>
|
||||||
<German>Verkauf aus meiner Ausrüstung.</German>
|
<German>Verkauf aus meiner Ausrüstung.</German>
|
||||||
<Russian>Продажа из снаряжения.</Russian>
|
<Russian>Продажа из снаряжения.</Russian>
|
||||||
<Spanish>Selling from gear.</Spanish>
|
<Spanish>Selling from your gear.</Spanish>
|
||||||
<French>Selling from gear.</French>
|
<French>Selling from your gear.</French>
|
||||||
<Czech>Selling from gear.</Czech>
|
<Czech>Selling from your gear.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_SELLING_VEHICLE">
|
<Key ID="STR_EPOCH_TRADE_SELLING_VEHICLE">
|
||||||
<English>Selling from vehicle.</English>
|
<English>Selling from your vehicle.</English>
|
||||||
<German>Verkauf aus dem Fahrzeug.</German>
|
<German>Verkauf aus dem Fahrzeug.</German>
|
||||||
<Russian>Продажа из транспорта.</Russian>
|
<Russian>Продажа из транспорта.</Russian>
|
||||||
<Spanish>Selling from vehicle.</Spanish>
|
<Spanish>Selling from your vehicle.</Spanish>
|
||||||
<French>Selling from vehicle.</French>
|
<French>Selling from your vehicle.</French>
|
||||||
<Czech>Selling from vehicle.</Czech>
|
<Czech>Selling from your vehicle.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_SELLING_BACKPACK">
|
<Key ID="STR_EPOCH_TRADE_SELLING_BACKPACK">
|
||||||
<English>Selling from backpack.</English>
|
<English>Selling from your backpack.</English>
|
||||||
<German>Verkauf aus dem Rucksack.</German>
|
<German>Verkauf aus dem Rucksack.</German>
|
||||||
<Russian>Продажа из рюкзака.</Russian>
|
<Russian>Продажа из рюкзака.</Russian>
|
||||||
<Spanish>Selling from backpack.</Spanish>
|
<Spanish>Selling from your backpack.</Spanish>
|
||||||
<French>Selling from backpack.</French>
|
<French>Selling from your backpack.</French>
|
||||||
<Czech>Selling from backpack.</Czech>
|
<Czech>Selling from your backpack.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_SELLING_ALL">
|
<Key ID="STR_EPOCH_TRADE_SELLING_ALL">
|
||||||
<English>These are all the items I'm selling.</English>
|
<English>These are all the items I'm selling.</English>
|
||||||
@@ -16094,28 +16094,28 @@
|
|||||||
<Czech>These are all the items I'm selling.</Czech>
|
<Czech>These are all the items I'm selling.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BUYING_VEHICLE">
|
<Key ID="STR_EPOCH_TRADE_BUYING_VEHICLE">
|
||||||
<English>Buying in vehicle.</English>
|
<English>Buying into your vehicle.</English>
|
||||||
<German>Kauf ins Fahrzeug.</German>
|
<German>Kauf ins Fahrzeug.</German>
|
||||||
<Russian>Покупка в транспорт.</Russian>
|
<Russian>Покупка в транспорт.</Russian>
|
||||||
<Spanish>Buying in vehicle.</Spanish>
|
<Spanish>Buying into your vehicle.</Spanish>
|
||||||
<French>Buying in vehicle.</French>
|
<French>Buying into your vehicle.</French>
|
||||||
<Czech>Buying in vehicle.</Czech>
|
<Czech>Buying into your vehicle.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BUYING_BACKPACK">
|
<Key ID="STR_EPOCH_TRADE_BUYING_BACKPACK">
|
||||||
<English>Buying in backpack.</English>
|
<English>Buying into your backpack.</English>
|
||||||
<German>Kauf in den Rucksack.</German>
|
<German>Kauf in den Rucksack.</German>
|
||||||
<Russian>Покупка в рюкзак.</Russian>
|
<Russian>Покупка в рюкзак.</Russian>
|
||||||
<Spanish>Buying in backpack.</Spanish>
|
<Spanish>Buying into your backpack.</Spanish>
|
||||||
<French>Buying in backpack.</French>
|
<French>Buying into your backpack.</French>
|
||||||
<Czech>Buying in backpack.</Czech>
|
<Czech>Buying into your backpack.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BUYING_GEAR">
|
<Key ID="STR_EPOCH_TRADE_BUYING_GEAR">
|
||||||
<English>Buying in gear.</English>
|
<English>Buying into your gear.</English>
|
||||||
<German>Kauf in meine Ausrüstung.</German>
|
<German>Kauf in meine Ausrüstung.</German>
|
||||||
<Russian>Покупка в снаряжение.</Russian>
|
<Russian>Покупка в снаряжение.</Russian>
|
||||||
<Spanish>Buying in gear.</Spanish>
|
<Spanish>Buying into your gear.</Spanish>
|
||||||
<French>Buying in gear.</French>
|
<French>Buying into your gear.</French>
|
||||||
<Czech>Buying in gear.</Czech>
|
<Czech>Buying into your gear.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_NOTHING">
|
<Key ID="STR_EPOCH_TRADE_NOTHING">
|
||||||
<English>Nothing</English>
|
<English>Nothing</English>
|
||||||
@@ -16147,18 +16147,6 @@
|
|||||||
<French>Détails</French>
|
<French>Détails</French>
|
||||||
<Czech>Podrobnosti</Czech>
|
<Czech>Podrobnosti</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_STUPID">
|
|
||||||
<English>I'm not stupid.</English>
|
|
||||||
<German>Ich bin doch nicht blöd.</German>
|
|
||||||
<Russian>Я не глупый.</Russian>
|
|
||||||
<Spanish>I'm not stupid.</Spanish>
|
|
||||||
<French>I'm not stupid.</French>
|
|
||||||
<Czech>I'm not stupid.</Czech>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_EPOCH_TRADE_NO_VEHICLE">
|
|
||||||
<English>I do not see any vehicle.</English>
|
|
||||||
<Russian>Я не вижу вашего транспорта.</Russian>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_EPOCH_TRADE_NO_BACKPACK">
|
<Key ID="STR_EPOCH_TRADE_NO_BACKPACK">
|
||||||
<English>You are not wearing a backpack.</English>
|
<English>You are not wearing a backpack.</English>
|
||||||
<German>Du hast keinen Rucksack.</German>
|
<German>Du hast keinen Rucksack.</German>
|
||||||
@@ -16167,6 +16155,9 @@
|
|||||||
<French>You are not wearing a backpack.</French>
|
<French>You are not wearing a backpack.</French>
|
||||||
<Czech>You are not wearing a backpack.</Czech>
|
<Czech>You are not wearing a backpack.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_EPOCH_TRADE_HAVE_BACKPACK">
|
||||||
|
<English>You already have a backpack.</English>
|
||||||
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_OFFER">
|
<Key ID="STR_EPOCH_TRADE_OFFER">
|
||||||
<English>I would offer %1 %2.</English>
|
<English>I would offer %1 %2.</English>
|
||||||
<German>Ich biete %1 %2.</German>
|
<German>Ich biete %1 %2.</German>
|
||||||
@@ -16176,7 +16167,7 @@
|
|||||||
<Czech>I would offer %1 %2.</Czech>
|
<Czech>I would offer %1 %2.</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_ACCEPT">
|
<Key ID="STR_EPOCH_TRADE_ACCEPT">
|
||||||
<English>I accept %1 items from %2.</English>
|
<English>I accept %1 items from your %2.</English>
|
||||||
<German>Ich nehme %1 aus %2.</German>
|
<German>Ich nehme %1 aus %2.</German>
|
||||||
<Russian>Я беру: %1 шт. из %2.</Russian>
|
<Russian>Я беру: %1 шт. из %2.</Russian>
|
||||||
<Spanish>I accept %1 items from %2.</Spanish>
|
<Spanish>I accept %1 items from %2.</Spanish>
|
||||||
@@ -16192,17 +16183,13 @@
|
|||||||
<Russian>Вы можете купить только один транспорт за сделку.</Russian>
|
<Russian>Вы можете купить только один транспорт за сделку.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_GEAR_FULL">
|
<Key ID="STR_EPOCH_TRADE_GEAR_FULL">
|
||||||
<English>You can only buy %1 primary, %2 sidearm and %3 tools in your gear.</English>
|
<English>You can only buy %1 primary, %2 sidearm and %3 tools into your gear.</English>
|
||||||
<Russian>Вы можете купить в снаряжение: оружия-%1, пистолетов-%2, инструментов-%3.</Russian>
|
<Russian>Вы можете купить в снаряжение: оружия-%1, пистолетов-%2, инструментов-%3.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_MAGS_FULL">
|
<Key ID="STR_EPOCH_TRADE_MAGS_FULL">
|
||||||
<English>You can only buy %1 magazines into your gear.</English>
|
<English>You can only buy %1 magazines into your gear.</English>
|
||||||
<Russian>Вы можете купить предметов в снаряжение: %1.</Russian>
|
<Russian>Вы можете купить предметов в снаряжение: %1.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BAG_FULL">
|
|
||||||
<English>You can only buy %1 backpacks into your gear.</English>
|
|
||||||
<Russian>Вы можете купить рюкзаков в снаряжение: %1.</Russian>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_EPOCH_TRADE_VEHICLE_WEPS">
|
<Key ID="STR_EPOCH_TRADE_VEHICLE_WEPS">
|
||||||
<English>You can only buy %1 weapons into your vehicle.</English>
|
<English>You can only buy %1 weapons into your vehicle.</English>
|
||||||
<Russian>Вы можете купить оружия в ваш автомобиль: %1.</Russian>
|
<Russian>Вы можете купить оружия в ваш автомобиль: %1.</Russian>
|
||||||
@@ -16215,10 +16202,6 @@
|
|||||||
<English>You can only buy %1 backpacks into your vehicle.</English>
|
<English>You can only buy %1 backpacks into your vehicle.</English>
|
||||||
<Russian>Вы можете купить рюкзаков в ваш транспорт: %1.</Russian>
|
<Russian>Вы можете купить рюкзаков в ваш транспорт: %1.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_NEED_BAG">
|
|
||||||
<English>You need a backpack.</English>
|
|
||||||
<Russian>Вам нужен рюкзак.</Russian>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_EPOCH_TRADE_BACKPACK_FULL">
|
<Key ID="STR_EPOCH_TRADE_BACKPACK_FULL">
|
||||||
<English>Total backpack space exceeded.</English>
|
<English>Total backpack space exceeded.</English>
|
||||||
</Key>
|
</Key>
|
||||||
@@ -16231,7 +16214,7 @@
|
|||||||
<Russian>В рюкзак поместится предметов: %1.</Russian>
|
<Russian>В рюкзак поместится предметов: %1.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BAG_BAGS">
|
<Key ID="STR_EPOCH_TRADE_BAG_BAGS">
|
||||||
<English>Only %1 bags will fit into your backpack.</English>
|
<English>You can't purchase a backpack into your backpack.</English>
|
||||||
<Russian>В рюкзак поместится рюкзаков: %1.</Russian>
|
<Russian>В рюкзак поместится рюкзаков: %1.</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_TRADE_BUY_IN_BACKPACK">
|
<Key ID="STR_EPOCH_TRADE_BUY_IN_BACKPACK">
|
||||||
@@ -16407,10 +16390,6 @@
|
|||||||
<French>Des places</French>
|
<French>Des places</French>
|
||||||
<Czech>Sedadla</Czech>
|
<Czech>Sedadla</Czech>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_EPOCH_YOUR_GEAR">
|
|
||||||
<English>your gear</English>
|
|
||||||
<Russian>вашего снаряжения</Russian>
|
|
||||||
</Key>
|
|
||||||
<Key ID="STR_EPOCH_METALFLOOR">
|
<Key ID="STR_EPOCH_METALFLOOR">
|
||||||
<English>Metal Floor</English>
|
<English>Metal Floor</English>
|
||||||
<German>Metal Floor</German>
|
<German>Metal Floor</German>
|
||||||
|
|||||||
Reference in New Issue
Block a user