Fuel container can be emptied now

This commit is contained in:
A Man
2019-10-30 10:03:16 +01:00
parent d233346563
commit 276615a8f1
6 changed files with 88 additions and 21 deletions

View File

@@ -1,8 +1,8 @@
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_vehicle","_finished","_soundSource","_fuelCan","_emptyCan"];
player removeAction s_player_fillgen;
s_player_fillgen = 1;
@@ -24,16 +24,16 @@ _fuelCan = nil;
if (_finished) then {
// take fuel can and replace with empty
if(!(_vehicle getVariable ["GeneratorFilled", false]) && !isNil "_fuelCan") then {
if(([player,_fuelCan] call BIS_fnc_invRemove) == 1) then {
_emptyCan = getText (configFile >> "CfgMagazines" >> _fuelCan >> "emptycan");
_emptyCan = getText (configFile >> "CfgMagazines" >> _fuelCan >> "containerEmpty");
player addMagazine _emptyCan;
// mark as once filled
_vehicle setVariable ["GeneratorFilled", true,true];
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
@@ -46,7 +46,7 @@ if (_finished) then {
localize "str_epoch_player_28" call dayz_rollingMessages;
["Working",0,[0,1,3,0]] call dayz_NutritionSystem;
};
} else {
} else {
// Start generator
_vehicle setVariable ["GeneratorRunning", true,true];
@@ -63,4 +63,4 @@ if (_finished) then {
};
dayz_actionInProgress = false;
s_player_fillgen = -1;
s_player_fillgen = -1;

View File

@@ -1,3 +1,6 @@
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
private ["_emptycan","_objectID","_objectUID","_obj","_fuelArray","_matchArray","_randomJerryCan","_fireIntensity","_dis","_sfx","_finished"];
//Tent Object
@@ -24,11 +27,8 @@ _matchArray = [];
} count DayZ_fuelCans;
//Make sure we have both components to create the fire.
if ((count _fuelArray == 0)) exitwith { systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { systemChat (localize ("str_setFireMatches")); };
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
if ((count _fuelArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { dayz_actionInProgress = false; systemChat (localize ("str_setFireMatches")); };
//Actionmenu tools
player removeAction s_player_destroytent;
@@ -46,10 +46,9 @@ if (!_finished or (isNull _obj)) exitWith {
//Jerry can system ** Needs redoing
//Select random can from array
_randomJerryCan = _fuelArray call BIS_fnc_selectRandom;
_randomJerryCan = _fuelArray call BIS_fnc_selectRandom;
_name = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "displayName");
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "emptycan");
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "containerEmpty");
_fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity");
if !(_randomJerryCan in magazines player) exitWith {
@@ -81,4 +80,4 @@ _obj inflame true;
//_obj spawn player_fireMonitor;
localize "str_success_tent_destroyed" call dayz_rollingMessages;
dayz_actionInProgress = false;
dayz_actionInProgress = false;

View File

@@ -1,5 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
"_emptycan","_started","_finished","_animState","_isRefuel","_type"];
@@ -8,7 +9,7 @@ _cantype = _array select 0;
_vehicle = _array select 1;
_type = typeOf _vehicle;
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan");
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "containerEmpty");
_configVeh = configFile >> "cfgVehicles" >> _type;
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameType = getText(_configVeh >> "displayName");