This commit is contained in:
vbawol
2013-01-29 00:36:55 -06:00
parent f0a8b3ddb9
commit f58858c013
14 changed files with 365 additions and 149 deletions

View File

@@ -58,6 +58,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
_hasBlood = "ItemBloodbag" in magazines player;
_hasToolbox = "ItemToolbox" in items player;
_hasJerry = "ItemJerrycan" in magazines player;
_hasJerryE = "ItemJerrycanEmpty" in magazines player;
_hasEtool = "ItemEtool" in weapons player;
_hasWire = "ItemWire" 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"];
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?
if (count weapons _unit > 0) then {
//Get mag array

View File

@@ -231,64 +231,37 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
s_player_sleep = -1;
};
//Repairing Vehicles
if ((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 (_isVehicle and (dayz_myCursorTarget != cursorTarget) and !_isMan and _hasToolbox and (damage cursorTarget < 1)) 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 (s_player_repair_crtl < 0) then {
if(["Wheel",_x,false] call fnc_inString) then {
_part = "PartWheel";
};
if(["Glass",_x,false] call fnc_inString) then {
_part = "PartGlass";
};
_vehicle = cursorTarget;
// 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
dayz_myCursorTarget = _vehicle;
_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];
};
_menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_vehicle, 0, true, false, "",""];
_menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_vehicle, 0, true, false, "",""];
} forEach _hitpoints;
if (_allFixed) then {
_vehicle setDamage 0;
s_player_repairActions set [count s_player_repairActions,_menu];
s_player_repairActions set [count s_player_repairActions,_menu1];
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];
@@ -422,6 +395,8 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4))
} else {
//Engineering
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = -1;
dayz_myCursorTarget = objNull;
{player removeAction _x} forEach s_player_madsci;s_player_madsci = [];