This commit is contained in:
A Clark
2012-11-15 12:26:14 -06:00
parent 039f1eb8da
commit 08e1942175
33 changed files with 396 additions and 265 deletions

View File

@@ -44,12 +44,12 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
_out = 1;
_in = _cost;
_textCurrency = getText(configFile >> "CfgMagazines" >> _part_in >> "displayName");
_textCurrency = getText(configFile >> _stype >> _part_in >> "displayName");
_Display = "Buy " + _textPart + " for " + str(_cost) + " " + _textCurrency;
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,];
_part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in], _order, true, true, "",""];
_Display = format["Buy %1 for %2 %3", _textPart, _cost, _textCurrency];
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
_part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in,"buy",_textPart,_textCurrency], _order, true, true, "",""];
diag_log format["DEBUG TRADER: %1", _part];
s_player_parts set [count s_player_parts,_part];

View File

@@ -0,0 +1,6 @@
private["_vehicle"];
_vehicle = _this select 3;
_vehicle setVehicleInit "this lock true";
_vehicle setVehicleInit "this lockCargo true";
processInitCommands;

View File

@@ -45,20 +45,11 @@ switch (_item) do {
};
case "Skin_Survivor2_DZ": {
_model = "Survivor2_DZ";
if (_isFemale) then {
_model = "SurvivorW2_DZ";
};
if (_isBandit) then {
_model = "Bandit1_DZ";
if (_isFemale) then {
_model = "BanditW1_DZ";
};
};
if (_isHero) then {
_model = "Survivor3_DZ";
if (_isFemale) then {
_model = "SurvivorW2_DZ";
};
};
};
};

View File

@@ -35,7 +35,7 @@ diag_log format["DEBUG Sell: %1", dayzTraderMenuResult];
_tid = _x select 12;
_actionFile = _x select 13;
_textPart = getText(configFile >> _stype >> _name >> "displayName");
_textPart = getText(configFile >> _stype >> _scurrency >> "displayName");
_File = "\z\addons\dayz_code\actions\" + _actionFile + ".sqf";
@@ -44,12 +44,12 @@ diag_log format["DEBUG Sell: %1", dayzTraderMenuResult];
_out = _sell;
_in = 1;
_textCurrency = getText(configFile >> "CfgMagazines" >> _part_out >> "displayName");
_textCurrency = getText(configFile >> _btype >> _part_in >> "displayName");
_Display = "Sell " + _textPart + " for " + str(_sell) + " " + _textCurrency;
_Display = format["Sell %1 for %2 %3", _textPart, _sell, _textCurrency];
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,];
_part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in], _order, true, true, "",""];
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,"buy",_textPart,_textCurrency];
_part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in,"sell",_textPart,_textCurrency], _order, true, true, "",""];
//diag_log format["DEBUG TRADER: %1", _part];
s_player_parts set [count s_player_parts,_part];

View File

@@ -0,0 +1,79 @@
private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"];
// [part_out,part_in, qty_out, qty_in, loc];
_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_obj = nearestObjects [(getPosATL player), [_part_in], 10];
_qty = count _obj;
};
if (_qty >= _qty_in) then {
if(_buy_o_sell == "buy") then {
for "_x" from 1 to _qty_in do {
player removeMagazine _part_in;
};
_dir = 90;
_location = [(position player),0,20,1,0,20,0] call BIS_fnc_findSafePos;
//place tent (local)
_veh = createVehicle [_part_out, _location, [], 0, "CAN_COLLIDE"];
_veh setdir _dir;
_veh setpos _location;
//_veh setPosATL _position;
player reveal _veh;
_location = getPosATL _veh;
_veh setVariable ["characterID",dayz_characterID,true];
// server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID]
dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_characterID];
publicVariable "dayzPublishVeh";
if (isServer) then {
dayzPublishVeh spawn server_publishVeh;
};
cutText [format[("Bought %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
};
_obj = _obj select 0;
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
dayzDeleteObj = [_objectID,_objectUID];
publicVariableServer "dayzDeleteObj";
if (isServer) then {
dayzDeleteObj call local_deleteObj;
};
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 = [];
s_player_parts_crtl = -1;
} else {
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};

View File

@@ -1,4 +1,4 @@
private["none"];
private["_none"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
//{player removeAction _x} forEach s_player_bank;s_player_bank = [];

View File

@@ -1,23 +1,16 @@
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty"];
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut"];
// [part_out,part_in, qty_out, qty_in,];
_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_textPartIn = getText(configFile >> "CfgMagazines" >> _part_in >> "displayName");
_textPartOut = getText(configFile >> "CfgMagazines" >> _part_out >> "displayName");
// not portable yet
//{player removeAction _x} forEach s_player_metals;s_player_metals = [];
//s_player_metal_crtl = -1;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
_qty = {_x == _part_in} count magazines player;
if (_qty >= _qty_in) then {
for "_x" from 1 to _qty_in do {
@@ -28,8 +21,11 @@ if (_qty >= _qty_in) then {
player addMagazine _part_out;
};
[player,"repair",0,false] call dayz_zombieSpeak;
// [player,"repair",0,false] call dayz_zombieSpeak;
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;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];

View File

@@ -0,0 +1,47 @@
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell"];
// [part_out,part_in, qty_out, qty_in,"buy"];
_part_out = (_this select 3) select 0;
_part_in = (_this select 3) select 1;
_qty_out = (_this select 3) select 2;
_qty_in = (_this select 3) select 3;
_buy_o_sell = (_this select 3) select 4;
_textPartIn = (_this select 3) select 5;
_textPartOut = (_this select 3) select 6;
if(_buy_o_sell == "buy") then {
_qty = {_x == _part_in} count magazines player;
} else {
_qty = {_x == _part_in} count weapons player;
};
if (_qty >= _qty_in) then {
for "_x" from 1 to _qty_in do {
if(_buy_o_sell == "buy") then {
player removeMagazine _part_in;
} else {
player removeWeapon _part_in;
};
};
for "_x" from 1 to _qty_out do {
if(_buy_o_sell == "buy") then {
player addWeapon _part_out;
} else {
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"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {
_needed = _qty_in - _qty;
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
};

View File

@@ -0,0 +1,6 @@
private["_vehicle"];
_vehicle = _this select 3;
_vehicle setVehicleInit "this lock false";
_vehicle setVehicleInit "this lockCargo false";
processInitCommands;