mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
0.8
This commit is contained in:
@@ -101,7 +101,7 @@ menu_RU_Citizen3 = [
|
|||||||
"friendly"
|
"friendly"
|
||||||
];
|
];
|
||||||
// Auto Traders
|
// Auto Traders
|
||||||
menu_CIV_Worker3 = [
|
menu_Worker3 = [
|
||||||
[["Cars",41],["Trucks Unarmed",42],["SUV",466],["Buses and Vans",467],["Offroad",43],["Helicopter Unarmed",44],["Military Unarmed",45]],
|
[["Cars",41],["Trucks Unarmed",42],["SUV",466],["Buses and Vans",467],["Offroad",43],["Helicopter Unarmed",44],["Military Unarmed",45]],
|
||||||
[],
|
[],
|
||||||
"friendly"
|
"friendly"
|
||||||
@@ -149,7 +149,7 @@ menu_RU_Villager3 = [
|
|||||||
menu_TK_CIV_Takistani04_EP1 = [
|
menu_TK_CIV_Takistani04_EP1 = [
|
||||||
[["Explosives",23]],
|
[["Explosives",23]],
|
||||||
[],
|
[],
|
||||||
"hostile"
|
"neutral"
|
||||||
];
|
];
|
||||||
|
|
||||||
// ["friendly"] must have more than -2000 humanity,
|
// ["friendly"] must have more than -2000 humanity,
|
||||||
@@ -177,7 +177,7 @@ waitUntil {time > 3};
|
|||||||
|
|
||||||
if ((!isServer) && (player != player)) then
|
if ((!isServer) && (player != player)) then
|
||||||
{
|
{
|
||||||
waitUntil {player == player};
|
waitUntil {player == player};
|
||||||
waitUntil {time > 3};
|
waitUntil {time > 3};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -202,6 +202,14 @@ if (isServer) then {
|
|||||||
"Ikarus",
|
"Ikarus",
|
||||||
"SUV_TK_CIV_EP1",
|
"SUV_TK_CIV_EP1",
|
||||||
"SUV_Green",
|
"SUV_Green",
|
||||||
|
"SUV_Yellow",
|
||||||
|
"SUV_White",
|
||||||
|
"SUV_Silver",
|
||||||
|
"SUV_Red",
|
||||||
|
"SUV_Pink",
|
||||||
|
"SUV_Orange",
|
||||||
|
"SUV_Charcoal",
|
||||||
|
"SUV_Blue",
|
||||||
"UH1H_DZ",
|
"UH1H_DZ",
|
||||||
"Mi17_Civilian",
|
"Mi17_Civilian",
|
||||||
"LandRover_CZ_EP1",
|
"LandRover_CZ_EP1",
|
||||||
@@ -234,6 +242,14 @@ if (isServer) then {
|
|||||||
0.01, // "Ikarus"
|
0.01, // "Ikarus"
|
||||||
0.1, // "SUV_TK_CIV_EP1"
|
0.1, // "SUV_TK_CIV_EP1"
|
||||||
0.1, // "SUV_Green",
|
0.1, // "SUV_Green",
|
||||||
|
0.1, // "SUV_Yellow",
|
||||||
|
0.1, // "SUV_White",
|
||||||
|
0.1, // "SUV_Silver",
|
||||||
|
0.1, // "SUV_Red",
|
||||||
|
0.1, // "SUV_Pink",
|
||||||
|
0.1, // "SUV_Orange",
|
||||||
|
0.1, // "SUV_Charcoal",
|
||||||
|
0.1, // "SUV_Blue",
|
||||||
0.05, // "UH1H_DZ"
|
0.05, // "UH1H_DZ"
|
||||||
0.09, // "Mi17_Civilian"
|
0.09, // "Mi17_Civilian"
|
||||||
0.11, // "LandRover_CZ_EP1"
|
0.11, // "LandRover_CZ_EP1"
|
||||||
@@ -248,7 +264,7 @@ if (isServer) then {
|
|||||||
0.1, // "tractor"
|
0.1, // "tractor"
|
||||||
0.1]; // "CSJ_GyroP"
|
0.1]; // "CSJ_GyroP"
|
||||||
|
|
||||||
AllowedVehiclesLimit = [ 5, // "Old_moto_TK_Civ_EP1",
|
AllowedVehiclesLimit = [ 5, // "Old_moto_TK_Civ_EP1",
|
||||||
10, // "MMT_Civ"
|
10, // "MMT_Civ"
|
||||||
10, // Old_bike_TK_INS_EP1
|
10, // Old_bike_TK_INS_EP1
|
||||||
5, // "ATV_US_EP1",
|
5, // "ATV_US_EP1",
|
||||||
@@ -256,7 +272,7 @@ if (isServer) then {
|
|||||||
5, // "datsun1_civil_3_open",
|
5, // "datsun1_civil_3_open",
|
||||||
3, // "Pickup_PK_TK_GUE_EP1",
|
3, // "Pickup_PK_TK_GUE_EP1",
|
||||||
2, // "Octavia_ACR"
|
2, // "Octavia_ACR"
|
||||||
2, // VWGolf
|
2, // "VWGolf"
|
||||||
3, // "Lada1",
|
3, // "Lada1",
|
||||||
3, // "Skoda",
|
3, // "Skoda",
|
||||||
3, // "car_sedan",
|
3, // "car_sedan",
|
||||||
@@ -266,6 +282,14 @@ if (isServer) then {
|
|||||||
2, // "Ikarus"
|
2, // "Ikarus"
|
||||||
4, // "SUV_TK_CIV_EP1"
|
4, // "SUV_TK_CIV_EP1"
|
||||||
2, // "SUV_Green",
|
2, // "SUV_Green",
|
||||||
|
1, // "SUV_Yellow",
|
||||||
|
1, // "SUV_White",
|
||||||
|
1, // "SUV_Silver",
|
||||||
|
1, // "SUV_Red",
|
||||||
|
1, // "SUV_Pink",
|
||||||
|
1, // "SUV_Orange",
|
||||||
|
1, // "SUV_Charcoal",
|
||||||
|
1, // "SUV_Blue",
|
||||||
2, // "UH1H_DZ"
|
2, // "UH1H_DZ"
|
||||||
2, // "Mi17_Civilian"
|
2, // "Mi17_Civilian"
|
||||||
2, // "LandRover_CZ_EP1"
|
2, // "LandRover_CZ_EP1"
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ if (_section and _hasToolbox) then {
|
|||||||
|
|
||||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
dayz_myCursorTarget = objNull;
|
dayz_myCursorTarget = objNull;
|
||||||
|
s_player_repair_crtl = -1;
|
||||||
|
|
||||||
//check if repaired fully
|
//check if repaired fully
|
||||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||||
|
|||||||
64
dayz_code/actions/repair_vehicle.sqf
Normal file
64
dayz_code/actions/repair_vehicle.sqf
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart"];
|
||||||
|
|
||||||
|
// [ _trader_id, _category, _action ];
|
||||||
|
_activatingPlayer = _this select 1;
|
||||||
|
|
||||||
|
_vehicle = _this select 3;
|
||||||
|
|
||||||
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
|
// dayz_myCursorTarget = _vehicle;
|
||||||
|
|
||||||
|
_allFixed = true;
|
||||||
|
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||||
|
|
||||||
|
{
|
||||||
|
_damage = [_vehicle,_x] call object_getHit;
|
||||||
|
_part = "PartGeneric";
|
||||||
|
|
||||||
|
//change "HitPart" to " - Part" rather than complicated string replace
|
||||||
|
_cmpt = toArray (_x);
|
||||||
|
_cmpt set [0,20];
|
||||||
|
_cmpt set [1,toArray ("-") select 0];
|
||||||
|
_cmpt set [2,20];
|
||||||
|
_cmpt = toString _cmpt;
|
||||||
|
|
||||||
|
if(["Engine",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartEngine";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["HRotor",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Fuel",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartFueltank";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Wheel",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartWheel";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Glass",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartGlass";
|
||||||
|
};
|
||||||
|
|
||||||
|
// get every damaged part no matter how tiny damage is!
|
||||||
|
if (_damage > 0) then {
|
||||||
|
|
||||||
|
_allFixed = false;
|
||||||
|
_color = "color='#ffff00'"; //yellow
|
||||||
|
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
|
||||||
|
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
|
||||||
|
|
||||||
|
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
|
||||||
|
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
||||||
|
s_player_repairActions set [count s_player_repairActions,_handle];
|
||||||
|
};
|
||||||
|
|
||||||
|
} forEach _hitpoints;
|
||||||
|
if (_allFixed) then {
|
||||||
|
_vehicle setDamage 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
s_player_repair_crtl = 1;
|
||||||
57
dayz_code/actions/salvage.sqf
Normal file
57
dayz_code/actions/salvage.sqf
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
private["_vehicle","_part","_hitpoint","_type","_selection","_array"];
|
||||||
|
_id = _this select 2;
|
||||||
|
_array = _this select 3;
|
||||||
|
_vehicle = _array select 0;
|
||||||
|
_part = _array select 1;
|
||||||
|
_hitpoint = _array select 2;
|
||||||
|
_type = typeOf _vehicle;
|
||||||
|
|
||||||
|
//
|
||||||
|
_hasToolbox = "ItemToolbox" in items player;
|
||||||
|
|
||||||
|
// moving this here because we need to know which part needed if we don't have it
|
||||||
|
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
|
||||||
|
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
|
||||||
|
|
||||||
|
if (_hasToolbox) then {
|
||||||
|
|
||||||
|
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||||
|
_vehicle removeAction _id;
|
||||||
|
|
||||||
|
//dont allow removal of damaged parts
|
||||||
|
if (_damage < 0.15) then {
|
||||||
|
|
||||||
|
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||||
|
if (_isOK) then {
|
||||||
|
|
||||||
|
|
||||||
|
//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
|
||||||
|
|
||||||
|
["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
|
//Success!
|
||||||
|
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"];
|
||||||
|
};
|
||||||
|
|
||||||
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
|
dayz_myCursorTarget = objNull;
|
||||||
|
s_player_repair_crtl = -1;
|
||||||
62
dayz_code/actions/salvage_vehicle.sqf
Normal file
62
dayz_code/actions/salvage_vehicle.sqf
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
private["_activatingPlayer","_trader_id","_category","_action","_id","_type","_loc","_name","_qty","_cost","_qty","_sell","_cur","_order","_tid","_currency","_actionFile","_in","_out","_part","_cat","_cancel","_Display","_File","_textCurrency","_textPart"];
|
||||||
|
|
||||||
|
// [ _trader_id, _category, _action ];
|
||||||
|
_activatingPlayer = _this select 1;
|
||||||
|
|
||||||
|
_vehicle = _this select 3;
|
||||||
|
|
||||||
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
|
// dayz_myCursorTarget = _vehicle;
|
||||||
|
|
||||||
|
_allFixed = true;
|
||||||
|
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||||
|
|
||||||
|
{
|
||||||
|
_damage = [_vehicle,_x] call object_getHit;
|
||||||
|
_part = "PartGeneric";
|
||||||
|
|
||||||
|
//change "HitPart" to " - Part" rather than complicated string replace
|
||||||
|
_cmpt = toArray (_x);
|
||||||
|
_cmpt set [0,20];
|
||||||
|
_cmpt set [1,toArray ("-") select 0];
|
||||||
|
_cmpt set [2,20];
|
||||||
|
_cmpt = toString _cmpt;
|
||||||
|
|
||||||
|
if(["Engine",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartEngine";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["HRotor",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Fuel",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartFueltank";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Wheel",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartWheel";
|
||||||
|
};
|
||||||
|
|
||||||
|
if(["Glass",_x,false] call fnc_inString) then {
|
||||||
|
_part = "PartGlass";
|
||||||
|
};
|
||||||
|
|
||||||
|
// allow removal of any lightly damaged parts
|
||||||
|
if (_damage < 0.25) then {
|
||||||
|
|
||||||
|
// Do not allow removal of engine or fueltanks
|
||||||
|
if( _part == "PartGlass" or _part == "PartWheel" ) then {
|
||||||
|
|
||||||
|
_color = "color='#ff0000'"; //red
|
||||||
|
_string = format["<t %2>Remove %1</t>",_cmpt,_color]; //Remove - Part
|
||||||
|
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
||||||
|
s_player_repairActions set [count s_player_repairActions,_handle];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
} forEach _hitpoints;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
s_player_repair_crtl = 1;
|
||||||
37
dayz_code/actions/siphonFuel.sqf
Normal file
37
dayz_code/actions/siphonFuel.sqf
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
private["_vehicle","_curFuel","_newFuel","_timeLeft"];
|
||||||
|
_vehicle = cursorTarget;
|
||||||
|
|
||||||
|
_canSize = getNumber(configFile >> "cfgMagazines" >> "ItemJerrycan" >> "fuelQuantity");
|
||||||
|
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||||
|
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||||
|
_nameType = getText(_configVeh >> "displayName");
|
||||||
|
_curFuel = ((fuel _vehicle) * _capacity);
|
||||||
|
_newFuel = (_curFuel - _canSize);
|
||||||
|
|
||||||
|
// calculate minimum needed fuel
|
||||||
|
_newFuel = (_newFuel / _capacity);
|
||||||
|
|
||||||
|
if (_newFuel > 0) then {
|
||||||
|
|
||||||
|
player removeMagazine "ItemJerrycanEmpty";
|
||||||
|
player addMagazine "ItemJerrycan";
|
||||||
|
|
||||||
|
player playActionNow "Medic";
|
||||||
|
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||||
|
|
||||||
|
_id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||||
|
|
||||||
|
sleep 6;
|
||||||
|
|
||||||
|
//apply newFuel to vehicle on every peer
|
||||||
|
["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
|
||||||
|
|
||||||
|
cutText [format["%1 has been drained for %2 litres of Fuel",_nameType,_canSize], "PLAIN DOWN"];
|
||||||
|
sleep 1;
|
||||||
|
|
||||||
|
call fnc_usec_medic_removeActions;
|
||||||
|
r_action = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cutText [format["%1 has no fuel.",_nameType], "PLAIN DOWN"];
|
||||||
|
};
|
||||||
@@ -21,44 +21,32 @@ if (_qty >= _qty_in) then {
|
|||||||
_bos = 1;
|
_bos = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
_isOk = false;
|
|
||||||
if(_buy_o_sell == "buy") then {
|
|
||||||
_config = (configFile >> "cfgMagazines" >> _part_out);
|
|
||||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
|
||||||
} else {
|
|
||||||
_isOk = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (_isOk) then {
|
|
||||||
|
|
||||||
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
|
||||||
|
|
||||||
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
|
|
||||||
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
for "_x" from 1 to _qty_out do {
|
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
player addMagazine _part_out;
|
|
||||||
};
|
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
|
||||||
|
|
||||||
// [player,"repair",0,false] call dayz_zombieSpeak;
|
waitUntil {!isNil "dayzTradeResult"};
|
||||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
|
||||||
} else {
|
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
|
||||||
|
if(dayzTradeResult == "PASS") then {
|
||||||
|
for "_x" from 1 to _qty_in do {
|
||||||
|
player removeMagazine _part_in;
|
||||||
};
|
};
|
||||||
dayzTradeResult = nil;
|
|
||||||
|
|
||||||
|
|
||||||
|
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 {
|
} else {
|
||||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
|
dayzTradeResult = nil;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos"];
|
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,];
|
// [part_out,part_in, qty_out, qty_in,];
|
||||||
|
|
||||||
//_activatingPlayer = _this select 1;
|
//_activatingPlayer = _this select 1;
|
||||||
@@ -12,34 +12,44 @@ _textPartIn = (_this select 3) select 5;
|
|||||||
_textPartOut = (_this select 3) select 6;
|
_textPartOut = (_this select 3) select 6;
|
||||||
//_traderID = (_this select 3) select 7;
|
//_traderID = (_this select 3) select 7;
|
||||||
|
|
||||||
|
_counter = 0;
|
||||||
|
_failed = false;
|
||||||
|
|
||||||
_qty = {_x == _part_in} count magazines player;
|
_qty = {_x == _part_in} count magazines player;
|
||||||
|
|
||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
_isOk = false;
|
// Take currency
|
||||||
if(_buy_o_sell == "buy") then {
|
for "_x" from 1 to _qty_in do {
|
||||||
_config = (configFile >> "cfgMagazines" >> _part_out);
|
player removeMagazine _part_in;
|
||||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
|
||||||
} else {
|
|
||||||
_isOk = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_isOk) then {
|
// check for space if buying and do not check if selling
|
||||||
|
for "_x" from 1 to _qty_out do {
|
||||||
for "_x" from 1 to _qty_in do {
|
if(_buy_o_sell == "buy") then {
|
||||||
player removeMagazine _part_in;
|
_isOk = [player,_part_out] call BIS_fnc_invAdd;
|
||||||
};
|
if (!_isOk) exitWith { _failed = true; };
|
||||||
|
_counter = _counter + 1;
|
||||||
for "_x" from 1 to _qty_out do {
|
} else {
|
||||||
player addMagazine _part_out;
|
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 [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// revert trade since it failed
|
||||||
|
if(_failed) then {
|
||||||
|
// add back currency
|
||||||
|
for "_x" from 1 to _qty_in do {
|
||||||
|
player addMagazine _part_in;
|
||||||
|
};
|
||||||
|
// remove partial trade
|
||||||
|
for "_x" from 1 to _counter do {
|
||||||
|
player removeMagazine _part_out;
|
||||||
|
};
|
||||||
|
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"];
|
||||||
|
};
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_needed = _qty_in - _qty;
|
_needed = _qty_in - _qty;
|
||||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||||
|
|||||||
@@ -23,55 +23,44 @@ if(_buy_o_sell == "buy") then {
|
|||||||
|
|
||||||
if (_qty >= _qty_in) then {
|
if (_qty >= _qty_in) then {
|
||||||
|
|
||||||
_isOk = false;
|
|
||||||
if(_buy_o_sell == "buy") then {
|
|
||||||
_config = (configFile >> "cfgWeapons" >> _part_out);
|
|
||||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
|
||||||
} else {
|
|
||||||
_isOk = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
if (_isOk) then {
|
|
||||||
|
|
||||||
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||||
|
|
||||||
waitUntil {!isNil "dayzTradeResult"};
|
waitUntil {!isNil "dayzTradeResult"};
|
||||||
|
|
||||||
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||||
|
|
||||||
if(dayzTradeResult == "PASS") then {
|
if(dayzTradeResult == "PASS") then {
|
||||||
|
|
||||||
for "_x" from 1 to _qty_in do {
|
for "_x" from 1 to _qty_in do {
|
||||||
if(_buy_o_sell == "buy") then {
|
if(_buy_o_sell == "buy") then {
|
||||||
player removeMagazine _part_in;
|
player removeMagazine _part_in;
|
||||||
} else {
|
} else {
|
||||||
player removeWeapon _part_in;
|
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 {
|
|
||||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
|
||||||
};
|
};
|
||||||
dayzTradeResult = nil;
|
|
||||||
|
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 {
|
} else {
|
||||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||||
};
|
};
|
||||||
|
dayzTradeResult = nil;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
_needed = _qty_in - _qty;
|
_needed = _qty_in - _qty;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
|
|||||||
_hasBlood = "ItemBloodbag" in magazines player;
|
_hasBlood = "ItemBloodbag" in magazines player;
|
||||||
_hasToolbox = "ItemToolbox" in items player;
|
_hasToolbox = "ItemToolbox" in items player;
|
||||||
_hasJerry = "ItemJerrycan" in magazines player;
|
_hasJerry = "ItemJerrycan" in magazines player;
|
||||||
|
_hasJerryE = "ItemJerrycanEmpty" in magazines player;
|
||||||
_hasEtool = "ItemEtool" in weapons player;
|
_hasEtool = "ItemEtool" in weapons player;
|
||||||
_hasWire = "ItemWire" in magazines player;
|
_hasWire = "ItemWire" in magazines player;
|
||||||
_hasPainkillers = "ItemPainkiller" in magazines player;
|
_hasPainkillers = "ItemPainkiller" in magazines player;
|
||||||
@@ -126,6 +127,13 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
|
|||||||
_action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycan' in magazines player"];
|
_action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycan' in magazines player"];
|
||||||
r_player_actions set [count r_player_actions,_action];
|
r_player_actions set [count r_player_actions,_action];
|
||||||
};
|
};
|
||||||
|
//CAN WE siphon fuel from THE OBJECT?
|
||||||
|
if ((fuel _unit > 0) and _hasJerryE) then {
|
||||||
|
r_action = true;
|
||||||
|
_action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[_unit], 0, true, true, "", "'ItemJerrycanEmpty' in magazines player"];
|
||||||
|
r_player_actions set [count r_player_actions,_action];
|
||||||
|
};
|
||||||
|
|
||||||
//CAN WE ISSUE ANOTHER KIND OF AMMUNITION?
|
//CAN WE ISSUE ANOTHER KIND OF AMMUNITION?
|
||||||
if (count weapons _unit > 0) then {
|
if (count weapons _unit > 0) then {
|
||||||
//Get mag array
|
//Get mag array
|
||||||
|
|||||||
@@ -231,64 +231,37 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
|||||||
s_player_sleep = -1;
|
s_player_sleep = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Repairing Vehicles
|
//Repairing Vehicles
|
||||||
if ((dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
|
if (_isVehicle and (dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) then {
|
||||||
_vehicle = cursorTarget;
|
|
||||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
|
||||||
dayz_myCursorTarget = _vehicle;
|
|
||||||
|
|
||||||
_allFixed = true;
|
|
||||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
|
||||||
|
|
||||||
{
|
if (s_player_repair_crtl < 0) then {
|
||||||
_damage = [_vehicle,_x] call object_getHit;
|
|
||||||
_part = "PartGeneric";
|
|
||||||
|
|
||||||
//change "HitPart" to " - Part" rather than complicated string replace
|
|
||||||
_cmpt = toArray (_x);
|
|
||||||
_cmpt set [0,20];
|
|
||||||
_cmpt set [1,toArray ("-") select 0];
|
|
||||||
_cmpt set [2,20];
|
|
||||||
_cmpt = toString _cmpt;
|
|
||||||
|
|
||||||
if(["Engine",_x,false] call fnc_inString) then {
|
|
||||||
_part = "PartEngine";
|
|
||||||
};
|
|
||||||
|
|
||||||
if(["HRotor",_x,false] call fnc_inString) then {
|
|
||||||
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
|
|
||||||
};
|
|
||||||
|
|
||||||
if(["Fuel",_x,false] call fnc_inString) then {
|
|
||||||
_part = "PartFueltank";
|
|
||||||
};
|
|
||||||
|
|
||||||
if(["Wheel",_x,false] call fnc_inString) then {
|
_vehicle = cursorTarget;
|
||||||
_part = "PartWheel";
|
|
||||||
};
|
|
||||||
|
|
||||||
if(["Glass",_x,false] call fnc_inString) then {
|
|
||||||
_part = "PartGlass";
|
|
||||||
};
|
|
||||||
|
|
||||||
// get every damaged part no matter how tiny damage is!
|
dayz_myCursorTarget = _vehicle;
|
||||||
if (_damage > 0) then {
|
|
||||||
|
|
||||||
_allFixed = false;
|
|
||||||
_color = "color='#ffff00'"; //yellow
|
|
||||||
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
|
|
||||||
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
|
|
||||||
|
|
||||||
_string = format["<t %2>Repair%1</t>",_cmpt,_color]; //Repair - Part
|
_menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_vehicle, 0, true, false, "",""];
|
||||||
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
_menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_vehicle, 0, true, false, "",""];
|
||||||
s_player_repairActions set [count s_player_repairActions,_handle];
|
|
||||||
};
|
|
||||||
|
|
||||||
} forEach _hitpoints;
|
s_player_repairActions set [count s_player_repairActions,_menu];
|
||||||
if (_allFixed) then {
|
s_player_repairActions set [count s_player_repairActions,_menu1];
|
||||||
_vehicle setDamage 0;
|
|
||||||
|
s_player_repair_crtl = 1;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
|
s_player_repair_crtl = -1;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_humanity = player getVariable ["humanity",0];
|
_humanity = player getVariable ["humanity",0];
|
||||||
|
|
||||||
@@ -422,6 +395,8 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
|
|||||||
} else {
|
} else {
|
||||||
//Engineering
|
//Engineering
|
||||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||||
|
s_player_repair_crtl = -1;
|
||||||
|
|
||||||
dayz_myCursorTarget = objNull;
|
dayz_myCursorTarget = objNull;
|
||||||
|
|
||||||
{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];
|
{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class CfgMods
|
|||||||
hidePicture = 0;
|
hidePicture = 0;
|
||||||
hideName = 0;
|
hideName = 0;
|
||||||
action = "http://www.dayepoch.com";
|
action = "http://www.dayepoch.com";
|
||||||
version = "0.796";
|
version = "0.8";
|
||||||
hiveVersion = 0.96; //0.93
|
hiveVersion = 0.96; //0.93
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ dayz_resetSelfActions = {
|
|||||||
s_player_warndog = -1;
|
s_player_warndog = -1;
|
||||||
s_player_followdog = -1;
|
s_player_followdog = -1;
|
||||||
s_last_trader = -1;
|
s_last_trader = -1;
|
||||||
|
s_player_repair_crtl = -1;
|
||||||
};
|
};
|
||||||
call dayz_resetSelfActions;
|
call dayz_resetSelfActions;
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
|
|||||||
class DAYZ_Version : CA_Version
|
class DAYZ_Version : CA_Version
|
||||||
{
|
{
|
||||||
idc = -1;
|
idc = -1;
|
||||||
text = "DayZ Epoch 0.796 (1.7.5.M1D25)";
|
text = "DayZ Epoch 0.8 (1.7.5.M1D25)";
|
||||||
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
|
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
|
||||||
};
|
};
|
||||||
class CA_TitleMainMenu;
|
class CA_TitleMainMenu;
|
||||||
|
|||||||
Reference in New Issue
Block a user