|
|
|
|
@@ -293,413 +293,73 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
|
|
|
|
|
|
|
|
|
_humanity = player getVariable ["humanity",0];
|
|
|
|
|
|
|
|
|
|
// Parts Trader #1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == parts_trader) then {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// All Traders
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType in serverTraders) then {
|
|
|
|
|
|
|
|
|
|
if(!isNil "s_last_trader" and s_player_parts_crtl == 1) then {
|
|
|
|
|
if(s_last_trader != _traderType) then {
|
|
|
|
|
s_player_parts_crtl -1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
//diag_log ("TRADER = " + str(serverTraders));
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
|
|
|
|
|
_traderMenu = call compile format["menu_%1;",_traderType];
|
|
|
|
|
|
|
|
|
|
diag_log ("TRADER = " + str(_traderMenu));
|
|
|
|
|
|
|
|
|
|
_humanity_logic = false;
|
|
|
|
|
if((_traderMenu select 2) == "friendly") then {
|
|
|
|
|
_low_high = "low";
|
|
|
|
|
if (_humanity < -2000) then {
|
|
|
|
|
_humanity_logic = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
if((_traderMenu select 2) == "neutral") then {
|
|
|
|
|
_humanity_logic = true;
|
|
|
|
|
};
|
|
|
|
|
if((_traderMenu select 2) == "hostile") then {
|
|
|
|
|
_low_high = "high";
|
|
|
|
|
if (_humanity > -2000) then {
|
|
|
|
|
_humanity_logic = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
if(_humanity_logic) then {
|
|
|
|
|
_cancel = player addAction ["Your humanity is too " + _low_high + " this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_parts_trader_menu = [["Car Parts",21],["Building Supplies",22],["Explosives",23]];
|
|
|
|
|
// Static Menu
|
|
|
|
|
{
|
|
|
|
|
diag_log format["DEBUG TRADER: %1", _x];
|
|
|
|
|
_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 6),(_x select 2),(_x select 5)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach (_traderMenu select 1);
|
|
|
|
|
// Database menu
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _parts_trader_menu;
|
|
|
|
|
} forEach (_traderMenu select 0);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
s_last_trader = _traderType;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Parts Trader #2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == parts_trader_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_parts_trader_2_menu = [["Car Parts",2121],["Building Supplies",2222],["Explosives",2323]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _parts_trader_2_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//weapon_trader #1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == weapon_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_weapon_trader_menu = [["Sidearm",11],["Rifle",12],["Shotgun",13],["Assault Rifle",14],["Machine Gun",15],["Sniper Rifle",16]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _weapon_trader_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//weapon_trader #2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == weapon_trader_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
_weapon_trader_2_menu = [["Sidearm",1111],["Rifle",1212],["Shotgun",1313],["Assault Rifle",1414],["Machine Gun",1515],["Sniper Rifle",1616]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _weapon_trader_2_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// can_trader #1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == can_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
// [_trader_id, _category, ];
|
|
|
|
|
_cantrader = player addAction ["Trade 3 Empty Soda Cans for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","ItemSodaEmpty",1,3,"buy","Empty Soda Cans","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
_cantrader1 = player addAction ["Trade 3 Empty Tin Cans for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","TrashTinCan",1,3,"buy","Empty Tin Cans","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
_cantrader2 = player addAction ["Trade 1 Empty Wiskey Bottle for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","TrashJackDaniels",1,1,"buy","Empty Wiskey Bottle","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader1];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader2];
|
|
|
|
|
|
|
|
|
|
_can_trader_menu = [["Food and Drinks",51],["Backpacks",52],["Toolbelt",53],["Clothes",54]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 98, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _can_trader_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// can_trader #2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == can_trader_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
// [_trader_id, _category, ];
|
|
|
|
|
_cantrader = player addAction ["Trade 3 Empty Soda Cans for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","ItemSodaEmpty",1,3,"buy","Empty Soda Cans","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
_cantrader1 = player addAction ["Trade 3 Empty Tin Cans for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","TrashTinCan",1,3,"buy","Empty Tin Cans","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
_cantrader2 = player addAction ["Trade 1 Empty Wiskey Bottle for 1 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","TrashJackDaniels",1,1,"buy","Empty Wiskey Bottle","Copper Bar"], 99, true, true, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader1];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cantrader2];
|
|
|
|
|
|
|
|
|
|
_can_trader_2_menu = [["Food and Drinks",5151],["Backpacks",5252],["Toolbelt",5353],["Clothes",5454]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 98, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _can_trader_2_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//ammo_trader #1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == ammo_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_ammo_trader_menu = [["Sidearm Ammo",1],["Rifle Ammo",2],["Shotgun and Crossbow Ammo",3],["Assault Rifle Ammo",4],["Machine Gun Ammo",5],["Sniper Rifle Ammo",6]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _ammo_trader_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//ammo_trader #2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == ammo_trader_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_ammo_trader_2_menu = [["Sidearm Ammo",1001],["Rifle Ammo",2002],["Shotgun and Crossbow Ammo",3003],["Assault Rifle Ammo",4004],["Machine Gun Ammo",5005],["Sniper Rifle Ammo",6006]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _ammo_trader_2_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
|
|
|
|
s_player_parts_crtl = -1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//boat_trader_1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == boat_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_boat_trader_menu = [["Boats Unarmed",49],["Boats Armed",499],["Wholesale",999]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _boat_trader_menu;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//auto_trader_1
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == auto_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_auto_trader_menu = [["Cars",41],["Trucks Unarmed",42],["SUV",466],["Buses and Vans",467],["Offroad",43],["Helicopter Unarmed",44],["Military Unarmed",45]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _auto_trader_menu;
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//auto_trader_2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == auto_trader_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
_auto_trader_2_menu = [["Trucks Armed",422],["Utility",46],["Helicopter Armed",444],["Military Armed",455],["Fuel Trucks",47],["Heavy Armor Unarmed",48]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _auto_trader_2_menu;
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// mad_sci
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == mad_sci) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
// [part_out, part_in, qty_out, qty_in,];
|
|
|
|
|
_zparts1 = player addAction ["Trade Zombie Parts for Bio Meat", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["FoodBioMeat","ItemZombieParts",1,1,"buy","Zombie Parts","Bio Meat"], 99, true, true, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_zparts1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_mad_sci_menu = [["Medical Supplies",31],["Chem-lites/Flares",32],["Smoke Grenades",33]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _mad_sci_menu;
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// mad_sci #2
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == mad_sci_2) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
if(_humanity < -2000) then {
|
|
|
|
|
|
|
|
|
|
_cancel = player addAction ["Your humanity is too low this trader refuses to talk to you.", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_cancel];
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
// [part_out, part_in, qty_out, qty_in,];
|
|
|
|
|
_zparts1 = player addAction ["Trade Zombie Parts for Bio Meat", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["FoodBioMeat","ItemZombieParts",1,1,"buy","Zombie Parts","Bio Meat"], 99, true, true, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_zparts1];
|
|
|
|
|
|
|
|
|
|
_mad_sci_2_menu = [["Medical Supplies",3131],["Chem-lites/Flares",3232],["Smoke Grenades",3333]];
|
|
|
|
|
{
|
|
|
|
|
// _title = _x select 0;
|
|
|
|
|
// _traderid = _x select 1;
|
|
|
|
|
// buy_or_sell.sqf [_trader_id, _category, ];
|
|
|
|
|
_buy = player addAction [(_x select 0), "\z\addons\dayz_code\actions\buy_or_sell.sqf",[(_x select 1),(_x select 0)], 99, true, false, "",""];
|
|
|
|
|
s_player_parts set [count s_player_parts,_buy];
|
|
|
|
|
|
|
|
|
|
} forEach _mad_sci_2_menu;
|
|
|
|
|
};
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// metals_trader
|
|
|
|
|
if (_isMan and !_isPZombie and _traderType == metals_trader) then {
|
|
|
|
|
|
|
|
|
|
if (s_player_parts_crtl < 0) then {
|
|
|
|
|
|
|
|
|
|
// [part_out, part_in, qty_out, qty_in,];
|
|
|
|
|
_metals1 = player addAction ["Trade 6 Copper for 1 Silver", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemSilverBar","ItemCopperBar",1,6,"buy","Copper","Silver"], 99, true, true, "",""];
|
|
|
|
|
_metals2 = player addAction ["Trade 1 Silver for 6 Copper", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemCopperBar","ItemSilverBar",6,1,"buy","Silver","Copper"], 98, true, true, "",""];
|
|
|
|
|
_metals4 = player addAction ["Trade 6 Silver for 1 Gold", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemGoldBar","ItemSilverBar",1,6,"buy","Silver","Gold"], 97, true, true, "",""];
|
|
|
|
|
_metals3 = player addAction ["Trade 1 Gold for 6 Silver", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemSilverBar","ItemGoldBar",6,1,"buy","Gold","Silver"], 97, true, true, "",""];
|
|
|
|
|
_metals5 = player addAction ["Buy Vault for 12 Gold", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemVault","ItemGoldBar",1,12,"buy","Gold","Vault"], 96, true, true, "",""];
|
|
|
|
|
_metals6 = player addAction ["Sell Vault for 6 Gold", "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",["ItemGoldBar","ItemVault",6,1,"sell","Vault","Gold"], 95, true, true, "",""];
|
|
|
|
|
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals1];
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals2];
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals3];
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals4];
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals5];
|
|
|
|
|
s_player_parts set [count s_player_parts,_metals6];
|
|
|
|
|
|
|
|
|
|
s_player_parts_crtl = 1;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (_isMan and !_isAlive and !_isZombie) then {
|
|
|
|
|
if (s_player_studybody < 0) then {
|
|
|
|
|
@@ -771,11 +431,12 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
|
|
|
|
{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];
|
|
|
|
|
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
|
|
|
|
|
|
|
|
|
{player removeAction _x} forEach s_player_bank;s_player_bank = [];
|
|
|
|
|
//{player removeAction _x} forEach s_player_bank;s_player_bank = [];
|
|
|
|
|
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
|
|
|
|
|
|
|
|
|
|
s_player_madsci_crtl = -1;
|
|
|
|
|
s_player_parts_crtl = -1;
|
|
|
|
|
s_last_trader = -1;
|
|
|
|
|
|
|
|
|
|
// lock unlock vehicles
|
|
|
|
|
s_player_lockUnlock_crtl = -1;
|
|
|
|
|
|