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;