new vault texture, out of stock messaged added back, lowered armor on
vault added damage handeler, Potential fix for for tag friendly option
on vehicles w/ player. New custom death screen, bulk trades with custom
supply crate model. Simlified dynamic vehicle system.
This commit is contained in:
vbawol
2013-01-30 13:29:48 -06:00
parent e24e30b15c
commit 13ca69a8fc
17 changed files with 139 additions and 55 deletions

View File

@@ -92,9 +92,9 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
// 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, "",""];
//_part = player addAction [_Display, _File,[_name,_bname,_out,_in,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
_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, "",""];
_part = player addAction [_Display, _File,[_name,_bname,_out,_in,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
} 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, "",""];

View File

@@ -12,44 +12,76 @@ _textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_traderID = (_this select 3) select 7;
_qty = {_x == _part_in} count magazines player;
_bos = 0;
_bulkqty = 0;
if (_qty >= _qty_in) then {
if(_buy_o_sell == "sell") then {
_bos = 0;
if(_buy_o_sell == "sell") then {
_bos = 1;
};
// SELL ONLY check if item if bulk
_bulkItem = call compile format["bulk_%1;",_part_in];
_bulkqty = {_x == _bulkItem} count magazines player;
_bos = 1;
};
if (_bulkqty >= 1) then {
// TODO: optimize for one db call only
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
// Find qty of box and
_bulkqty = getNumber (configFile >> "CfgMagazines" >> _bulkItem >> "count");
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
// increment trader for each
for "_x" from 1 to _bulkqty do {
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
waitUntil {!isNil "dayzTradeResult"};
waitUntil {!isNil "dayzTradeResult"};
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
if(dayzTradeResult == "PASS") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
if(dayzTradeResult == "PASS") then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
};
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
waitUntil {!isNil "dayzTradeResult"};
if(dayzTradeResult == "PASS") then {
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
// [player,"repair",0,false] call dayz_zombieSpeak;
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
};
dayzTradeResult = nil;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};
};

View File

@@ -153,6 +153,15 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
};
};
} forEach _magTypes;
} else {
// should only fire if cursor target is man and not vehicle
if ((isPlayer _unit) and !(_charID in _friendlies)) then {
r_action = true;
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""];
r_player_actions set [count r_player_actions,_action];
};
};
//CAN CARRY BACKPACK
if ((_type in USEC_PackableObjects) and (_classbag == "")) then {
@@ -188,12 +197,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
};
};
if ((isPlayer _unit) and !(_charID in _friendlies)) then {
r_action = true;
// TODO: prevent menu on vehicle, first attempt did not work "vehicle _unit == _unit"
_action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""];
r_player_actions set [count r_player_actions,_action];
};
if (r_action) then {
r_action_targets = r_action_targets + [_unit];

View File

@@ -271,7 +271,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
// All Traders
if (_isMan and !_isPZombie and _traderType in serverTraders) then {
if(!isNil "s_last_trader" and s_player_parts_crtl == 1) then {
if((!isNil "s_last_trader") and s_player_parts_crtl == 1) then {
if(s_last_trader != _traderType) then {
s_player_parts_crtl -1;
};
@@ -281,7 +281,6 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
//diag_log ("TRADER = " + str(serverTraders));
_traderMenu = call compile format["menu_%1;",_traderType];
diag_log ("TRADER = " + str(_traderMenu));