mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-11 10:42:58 +03:00
0.992
+ Added variable pricing to traders. Stock under 5 will be sold at the buy price and over 50 will be bought at the sell price. + Fixed trades not forcing a gear save and added more forced gear saves. + Added test for time based UID for purchased vehicles. + Reduced humanity gained by using a blood bag to 100 down from 250. + Added 5 minute penalty knockout for combat loggers. + Added prevention to logging out in a trader city. fixes #171 + Changed cargo check to only show on alive vehicles. Fixes #176 + Potential fix for gunner on armored SUV. Fixes #172 + Fixes for refueling and repairing that was broken by 1.7.61 + Removed taming of dogs for now. fixes #162
This commit is contained in:
@@ -18,6 +18,10 @@ if (_ammo != "") then {
|
||||
_vehicle removeMagazineTurret [_ammo,_turret];
|
||||
_vehicle addMagazineTurret [_ammo,_turret];
|
||||
player removeMagazine _ammo;
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
cutText [format["You have successfully loaded %1 ammunition.",_ammoType], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format["You need %1 type of ammo to do this.",_text], "PLAIN DOWN"];
|
||||
|
||||
@@ -36,6 +36,10 @@ if (_hasbottleitem and _hastinitem) then {
|
||||
player addMagazine "ItemWaterbottleBoiled";
|
||||
|
||||
};
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
|
||||
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_02") , "PLAIN DOWN"];
|
||||
|
||||
@@ -78,6 +78,10 @@ if(!_cancel) then {
|
||||
|
||||
player removeMagazine _item;
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
@@ -95,9 +99,9 @@ if(!_cancel) then {
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariable "dayzPublishObj";
|
||||
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
sleep 2;
|
||||
player allowDamage true;
|
||||
|
||||
@@ -76,6 +76,19 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
_sqty = _sell select 0;
|
||||
_sname = _sell select 1;
|
||||
_stype = _sell select 2;
|
||||
switch(true)do{
|
||||
case (_stype == 1): {
|
||||
_stype = "CfgMagazines";
|
||||
};
|
||||
case (_stype == 2): {
|
||||
_stype = "CfgVehicles";
|
||||
};
|
||||
case (_stype == 3): {
|
||||
_stype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of sell item
|
||||
_textCurrencySell = getText(configFile >> _stype >> _sname >> "displayName");
|
||||
|
||||
// Menu sort order
|
||||
_order = _x select 5;
|
||||
@@ -89,16 +102,23 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
|
||||
// Allways 1 for now
|
||||
_out = 1;
|
||||
// qty consumed of bname
|
||||
_in = _bqty;
|
||||
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
if(_qty <= 0) then {
|
||||
_Display = format["Buy %1 (Out of Stock: %2)", _textPart, _qty];
|
||||
_part = player addAction [_Display, "\z\addons\dayz_code\actions\trade_cancel.sqf",[], 0, true, false, "",""];
|
||||
} else {
|
||||
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _in, _textCurrency, _qty];
|
||||
_part = player addAction [_Display, _File,[_name,_bname,_out,_in,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
|
||||
// if over 50 in stock lower price to that of sell price
|
||||
if(_qty >= 50) then {
|
||||
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _sqty, _textCurrencySell, _qty];
|
||||
_part = player addAction [_Display, _File,[_name,_sname,_out,_sqty,"buy",_textCurrencySell,_textPart,_header], _order, true, true, "",""];
|
||||
} else {
|
||||
_Display = format["Buy %1 (%2) for %3 %4 (Available: %5)", _textPart, _name, _bqty, _textCurrency, _qty];
|
||||
_part = player addAction [_Display, _File,[_name,_bname,_out,_bqty,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
diag_log format["DEBUG TRADER: %1", _part];
|
||||
|
||||
@@ -26,6 +26,9 @@ _cookedmeat = meatcooked;
|
||||
player addMagazine _meatcooked;
|
||||
if !(_meat in magazines player) exitWith {cutText [format[(localize "str_player_31"),_text,"cook"] , "PLAIN DOWN"]};
|
||||
};
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
|
||||
};
|
||||
} forEach _rawmeat;
|
||||
@@ -10,6 +10,9 @@ if ("ItemJerrycanEmpty" in magazines player) then {
|
||||
player removeMagazine "ItemJerrycanEmpty";
|
||||
player addMagazine "ItemJerrycan";
|
||||
};
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=10;
|
||||
@@ -17,6 +20,8 @@ if ("ItemJerrycanEmpty" in magazines player) then {
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
|
||||
|
||||
cutText [format[(localize "str_player_09"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_10") , "PLAIN DOWN"];
|
||||
|
||||
@@ -84,6 +84,9 @@ if (_hasrequireditem or _bypass) then {
|
||||
_dir = getDir player;
|
||||
player removeMagazine _item;
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
@@ -104,7 +107,7 @@ if (_hasrequireditem or _bypass) then {
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariable "dayzPublishObj";
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
sleep 2;
|
||||
player allowDamage true;
|
||||
|
||||
@@ -76,7 +76,7 @@ player setVariable["medForceUpdate",true];
|
||||
|
||||
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
|
||||
dayzPlayerSave = [player,[],true];
|
||||
publicVariable "dayzPlayerSave";
|
||||
publicVariableServer "dayzPlayerSave";
|
||||
|
||||
dayz_lastMeal = time;
|
||||
dayz_hunger = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ if(!(alive _item)) then {
|
||||
|
||||
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
|
||||
dayzPlayerSave = [player,[],true];
|
||||
publicVariable "dayzPlayerSave";
|
||||
publicVariableServer "dayzPlayerSave";
|
||||
|
||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
|
||||
_vehicle = cursorTarget;
|
||||
|
||||
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not refuel while someone is in the vehicle", "PLAIN DOWN"]};
|
||||
|
||||
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
@@ -14,6 +16,9 @@ _newFuel = (_newFuel / _capacity);
|
||||
player removeMagazine "ItemJerrycan";
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
player playActionNow "Medic";
|
||||
_dis=10;
|
||||
_sfx = "refuel";
|
||||
@@ -23,10 +28,14 @@ _sfx = "refuel";
|
||||
sleep 6;
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
publicVariable "dayzSetFuel";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
|
||||
|
||||
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
|
||||
|
||||
sleep 1;
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
|
||||
@@ -6,6 +6,8 @@ _part = _array select 1;
|
||||
_hitpoint = _array select 2;
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not repair while someone is in the vehicle", "PLAIN DOWN"]};
|
||||
|
||||
//
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
_section = _part in magazines player;
|
||||
@@ -26,6 +28,9 @@ if (_section and _hasToolbox) then {
|
||||
|
||||
player removeMagazine _part;
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
//Fix the part
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
|
||||
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
|
||||
@@ -50,6 +55,7 @@ if (_section and _hasToolbox) then {
|
||||
|
||||
//Success!
|
||||
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
|
||||
|
||||
disableSerialization;
|
||||
|
||||
_id = _this select 2;
|
||||
_array = _this select 3;
|
||||
_vehicle = _array select 0;
|
||||
@@ -6,6 +9,12 @@ _part = _array select 1;
|
||||
_hitpoint = _array select 2;
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
|
||||
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not salvage while someone is in the vehicle", "PLAIN DOWN"]};
|
||||
|
||||
_isOK = false;
|
||||
_brokenPart = false;
|
||||
|
||||
//
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
|
||||
@@ -26,20 +35,24 @@ if (_hasToolbox) then {
|
||||
//dont allow removal of damaged parts
|
||||
if (_damage < 1) then {
|
||||
|
||||
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||
if (_isOK) then {
|
||||
|
||||
// the more damaged the part the higher the chance to loose the part.
|
||||
// 0.25 = 25% chance to loose part
|
||||
// 0.5 = 50% chance to loose part
|
||||
// 0.75 = 75% chance to loose part
|
||||
// 0.99 = 99% chance to loose part
|
||||
_findPercent = (1 - _damage) * 10;
|
||||
if(ceil (random _findPercent) == 1) then {
|
||||
_isOK = true;
|
||||
_brokenPart = true;
|
||||
} else {
|
||||
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||
_brokenPart = false;
|
||||
|
||||
_findPercent = (1 - _damage) * 10;
|
||||
// X = 1 - 0.25 = 0.75 x 10 == 7.5
|
||||
// X = 1 - 0.99 = 0.01 x 10 == 0.1
|
||||
|
||||
call dayz_forceSave;
|
||||
|
||||
};
|
||||
|
||||
|
||||
if (_isOK) then {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
//break the part
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
|
||||
|
||||
@@ -50,25 +63,23 @@ if (_hasToolbox) then {
|
||||
publicVariable "dayzSetFix";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFix call object_setFixServer;
|
||||
}
|
||||
|
||||
player playActionNow "Medic";
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
null = [player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep 5;
|
||||
_vehicle setvelocity [0,0,1];
|
||||
|
||||
if(ceil (random _findPercent) == 1) then {
|
||||
// loose part and damage vehicle
|
||||
player removeMagazine _part;
|
||||
if(_brokenPart) then {
|
||||
//Failed!
|
||||
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
} else {
|
||||
//Success!
|
||||
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
|
||||
} else {
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
|
||||
@@ -56,6 +56,19 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
_bqty = _buy select 0;
|
||||
_bname = _buy select 1;
|
||||
_btype = _buy select 2;
|
||||
switch(true)do{
|
||||
case (_btype == 1): {
|
||||
_btype = "CfgMagazines";
|
||||
};
|
||||
case (_btype == 2): {
|
||||
_btype = "CfgVehicles";
|
||||
};
|
||||
case (_btype == 3): {
|
||||
_btype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of buy item
|
||||
_textCurrencyBuy = getText(configFile >> _btype >> _bname >> "displayName");
|
||||
|
||||
// Sell data from array
|
||||
_sell = _x select 4;
|
||||
@@ -110,15 +123,36 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
_count = {_x == _name} count weapons player;
|
||||
};
|
||||
|
||||
if (_count > 0) then {
|
||||
_Display = format["Sell %1 for %2 %3 each", _textPart, _sqty, _textCurrency];
|
||||
} else {
|
||||
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _sqty, _textCurrency];
|
||||
};
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
// if under 5 in stock raise price to that of buy price
|
||||
if(_qty <= 5) then {
|
||||
|
||||
if (_count > 0) then {
|
||||
_Display = format["Sell %1 for %2 %3 each", _textPart, _bqty, _textCurrencyBuy];
|
||||
} else {
|
||||
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _bqty, _textCurrencyBuy];
|
||||
};
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
|
||||
_part = player addAction [_Display, _File,[_sname,_name,_bqty,_in,"sell",_textPart,_textCurrencyBuy,_header], _order, true, true, "",""];
|
||||
|
||||
} else {
|
||||
|
||||
if (_count > 0) then {
|
||||
_Display = format["Sell %1 for %2 %3 each", _textPart, _sqty, _textCurrency];
|
||||
} else {
|
||||
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _sqty, _textCurrency];
|
||||
};
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
|
||||
_part = player addAction [_Display, _File,[_sname,_name,_sqty,_in,"sell",_textPart,_textCurrency,_header], _order, true, true, "",""];
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
_part = player addAction [_Display, _File,[_sname,_name,_out,_in,"sell",_textPart,_textCurrency,_header], _order, true, true, "",""];
|
||||
|
||||
diag_log format["DEBUG TRADER: %1", _part];
|
||||
s_player_parts set [count s_player_parts,_part];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
|
||||
_vehicle = cursorTarget;
|
||||
|
||||
// if ((count (crew _vehicle)) > 0) exitWith {cutText ["You may not sihpon fuel while someone is in the vehicle", "PLAIN DOWN"]};
|
||||
|
||||
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
@@ -16,6 +18,9 @@ if (_newFuel > 0) then {
|
||||
player removeMagazine "ItemJerrycanEmpty";
|
||||
player addMagazine "ItemJerrycan";
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
player playActionNow "Medic";
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
@@ -27,10 +32,15 @@ if (_newFuel > 0) then {
|
||||
//["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
|
||||
|
||||
|
||||
|
||||
sleep 1;
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
|
||||
@@ -45,6 +45,9 @@ if (_qty >= _qty_in) then {
|
||||
for "_x" from 1 to _qty_in do {
|
||||
player removeMagazine _part_in;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
_dir = round(random 360);
|
||||
|
||||
@@ -73,12 +76,17 @@ if (_qty >= _qty_in) then {
|
||||
_veh call fnc_vehicleEventHandler;
|
||||
|
||||
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
|
||||
} else {
|
||||
// Sell Vehicle
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
_obj = _obj select 0;
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
@@ -103,7 +111,7 @@ if (_qty >= _qty_in) then {
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("No %1 found within 20 meters."),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
cutText [format[("No %1 found within 20 meters."),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -46,13 +46,15 @@ if (_qty >= _qty_in) then {
|
||||
for "_x" from 1 to _qty_in do {
|
||||
player removeMagazine _part_in;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
_dir = round(random 360);
|
||||
|
||||
|
||||
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
|
||||
if(count _helipad > 0) then {
|
||||
_location = [(getPosATL (_helipad select 0)),0,10,1,0,2000,0] call BIS_fnc_findSafePos;
|
||||
_location = (getPosATL (_helipad select 0));
|
||||
} else {
|
||||
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
@@ -76,16 +78,20 @@ if (_qty >= _qty_in) then {
|
||||
dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
|
||||
publicVariableServer "dayzPublishVeh";
|
||||
|
||||
// check if this will add the needed event handlers to correctly track damage client side
|
||||
// event handlers to correctly track damage client side
|
||||
_veh call fnc_vehicleEventHandler;
|
||||
|
||||
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
// Sell Vehicle
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
_obj = _obj select 0;
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
@@ -98,6 +104,7 @@ if (_qty >= _qty_in) then {
|
||||
deleteVehicle _obj;
|
||||
|
||||
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
@@ -110,7 +117,7 @@ if (_qty >= _qty_in) then {
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("No %1 found within 20 meters. "),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
cutText [format[("No %1 found within 20 meters. "),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -43,6 +43,10 @@ if (_bulkqty >= 1) then {
|
||||
|
||||
_part_in = "bulk_" + _part_in;
|
||||
player removeMagazine _part_in;
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
diag_log format["DEBUG remove magazine %1", _part_in];
|
||||
|
||||
// increment trader for each
|
||||
@@ -65,8 +69,6 @@ if (_bulkqty >= 1) then {
|
||||
//
|
||||
|
||||
if (_part_out == "ItemSilverBar" and _qty_out >= 30) then {
|
||||
|
||||
|
||||
|
||||
// find number of gold
|
||||
_gold_out = _qty_out / 30;
|
||||
@@ -90,9 +92,6 @@ if (_bulkqty >= 1) then {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
@@ -100,6 +99,9 @@ if (_bulkqty >= 1) then {
|
||||
};
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
dayzTradeResult = nil;
|
||||
@@ -138,8 +140,11 @@ if (_bulkqty >= 1) then {
|
||||
// player addBackpack _part_out;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
|
||||
@@ -36,7 +36,11 @@ if (_bulkqty >= 1) then {
|
||||
|
||||
_part_in = "bulk_" + _part_in;
|
||||
player removeMagazine _part_in;
|
||||
diag_log format["DEBUG remove magazine %1", _part_in];
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
// diag_log format["DEBUG remove magazine %1", _part_in];
|
||||
|
||||
// increment trader for each
|
||||
for "_x" from 1 to 12 do {
|
||||
@@ -96,6 +100,9 @@ if (_bulkqty >= 1) then {
|
||||
};
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
dayzTradeResult = nil;
|
||||
@@ -134,10 +141,14 @@ if (_bulkqty >= 1) then {
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
// [player,"repair",0,false] call dayz_zombieSpeak;
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),(_qty_in*_qty),_textPartIn,(_qty_out*_qty),_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ if (_qty >= _qty_in) then {
|
||||
};
|
||||
if(_total_out > 0) then {
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_total_in,_textPartIn,_total_out,_textPartOut], "PLAIN DOWN"];
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
@@ -97,6 +97,8 @@ if (_bulkqty >= 1) then {
|
||||
};
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
dayzTradeResult = nil;
|
||||
|
||||
@@ -136,6 +138,8 @@ if (_bulkqty >= 1) then {
|
||||
|
||||
// [player,"repair",0,false] call dayz_zombieSpeak;
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
disableSerialization;
|
||||
call dayz_forceSave;
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
private["_position","_tent","_location","_isOk","_backpack","_tentType","_trg","_key"];
|
||||
//check if can pitch here
|
||||
call gear_ui_init;
|
||||
|
||||
disableSerialization;
|
||||
|
||||
_playerPos = getPosATL player;
|
||||
_item = _this;
|
||||
_hastentitem = _this in magazines player;
|
||||
@@ -101,6 +103,9 @@ if(!_cancel) then {
|
||||
if (!_isOk) then {
|
||||
//remove tentbag
|
||||
player removeMagazine _item;
|
||||
|
||||
call dayz_forceSave;
|
||||
|
||||
_dir = round(direction player);
|
||||
|
||||
//wait a bit
|
||||
@@ -137,7 +142,6 @@ if(!_cancel) then {
|
||||
dayzPublishObj = [dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
|
||||
cutText ["You have setup your Safe", "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user