+ Fixed detection of vehicles in vehicle sell menu
+ Added trade in progress checks to all traders.
+ set pos after direction on deployables when placed.
+ Server side set pos after direction when spawning anything.
This commit is contained in:
vbawol
2013-02-19 08:02:18 -06:00
parent 0dd7227d5c
commit fa5a0902f9
17 changed files with 77 additions and 21 deletions

View File

@@ -93,6 +93,7 @@ if (_hasrequireditem or _bypass) then {
player allowDamage false;
_object = createVehicle [_classname, _built_location, [], 0, "CAN_COLLIDE"];
_object setDir _dir;
_object setpos _built_location;
player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];

View File

@@ -91,7 +91,7 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
_count = 0;
if(_type == "CfgVehicles") then {
_count = {_x == _name} count (position player nearObjects [_name,10]);
_count = {(typeOf _x) == _name} count (nearestObjects [player, [_name], 10]);
};
if(_type == "CfgMagazines") then {
_count = {_x == _name} count magazines player;

View File

@@ -1,5 +1,8 @@
private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// [part_out,part_in, qty_out, qty_in, loc];
_activatingPlayer = _this select 1;
@@ -93,4 +96,6 @@ if (_qty >= _qty_in) then {
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
TradeInprogress = false;

View File

@@ -1,5 +1,8 @@
private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
// [part_out,part_in, qty_out, qty_in, loc];
_activatingPlayer = _this select 1;
@@ -100,4 +103,6 @@ if (_qty >= _qty_in) then {
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
TradeInprogress = false;

View File

@@ -1,6 +1,9 @@
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty"];
// [part_out,part_in, qty_out, qty_in,];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_activatingPlayer = _this select 1;
_part_out = (_this select 3) select 0;
@@ -149,4 +152,6 @@ if (_bulkqty >= 1) then {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
};
TradeInprogress = false;

View File

@@ -1,6 +1,9 @@
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_isOk"];
// [part_out,part_in, qty_out, qty_in,];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_activatingPlayer = _this select 1;
_part_out = (_this select 3) select 0;
@@ -144,4 +147,6 @@ if (_bulkqty >= 1) then {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
};
TradeInprogress = false;

View File

@@ -1,6 +1,9 @@
private["_activatingPlayer","_part_out","_part_in","_qty_out","_qty_in","_buy_o_sell","_textPartIn","_textPartOut","_traderID","_counter","_failed","_qty","_isOk","_needed"];
// [part_out,part_in, qty_out, qty_in,];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
//_activatingPlayer = _this select 1;
_part_out = (_this select 3) select 0;
@@ -13,8 +16,12 @@ _textPartOut = (_this select 3) select 6;
//_traderID = (_this select 3) select 7;
_counter = 0;
_success = false;
_failed = false;
_total_in = 0;
_total_out = 0;
_qty = {_x == _part_in} count magazines player;
// find total number of possible trades
@@ -22,6 +29,8 @@ _total_trades = floor (_qty / _qty_in);
if (_qty >= _qty_in) then {
// trade all items
for "_x" from 1 to _total_trades do {
@@ -53,12 +62,20 @@ if (_qty >= _qty_in) then {
};
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
} else {
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
sleep 2;
_total_in = _total_in + _qty_in;
_total_out = _total_out + _qty_out;
_success = true;
};
};
if(_success) then {
cutText [format[("Traded %1 %2 for %3 %4"),_total_in,_textPartIn,_total_out,_textPartOut], "PLAIN DOWN"];
};
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
TradeInprogress = false;

View File

@@ -1,6 +1,9 @@
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_traderID","_bos","_bulkItem","_bulkqty","_gold_out","_gold_qty_out","_partial_qty_out","_silver_qty_out","_needed","_activatingPlayer","_textPartIn","_textPartOut"];
// [part_out,part_in, qty_out, qty_in,"buy"];
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
_activatingPlayer = _this select 1;
_part_out = (_this select 3) select 0;
@@ -147,4 +150,6 @@ if (_bulkqty >= 1) then {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};
};
TradeInprogress = false;