mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Fix siphon fuel
ItemJerrycanEmpty no longer inherits from ItemJerrycan
This commit is contained in:
@@ -282,6 +282,8 @@ class ItemFuelBarrel: CA_Magazine
|
|||||||
model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d";
|
model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d";
|
||||||
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
|
picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa";
|
||||||
descriptionShort = "210 litres of fuel per barrel";
|
descriptionShort = "210 litres of fuel per barrel";
|
||||||
|
fireIntensity = 6; //used for tent burning
|
||||||
|
emptycan = "ItemFuelBarrelEmpty";
|
||||||
};
|
};
|
||||||
class ItemFuelBarrelEmpty: ItemFuelBarrel
|
class ItemFuelBarrelEmpty: ItemFuelBarrel
|
||||||
{
|
{
|
||||||
@@ -292,15 +294,16 @@ class ItemFuelBarrelEmpty: ItemFuelBarrel
|
|||||||
displayName = "Fuel Barrel (Empty)";
|
displayName = "Fuel Barrel (Empty)";
|
||||||
picture = "\z\addons\dayz_epoch\pictures\equip_oildrum_e_CA.paa";
|
picture = "\z\addons\dayz_epoch\pictures\equip_oildrum_e_CA.paa";
|
||||||
descriptionShort = "210 litres of fuel per barrel (Empty)";
|
descriptionShort = "210 litres of fuel per barrel (Empty)";
|
||||||
|
fullcan = "ItemFuelBarrel";
|
||||||
class ItemActions {
|
class ItemActions {
|
||||||
class Crafting
|
class Crafting
|
||||||
{
|
{
|
||||||
text = $STR_EPOCH_PLAYER_276;
|
text = $STR_EPOCH_PLAYER_276;
|
||||||
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem; r_action_count = r_action_count + 1;";
|
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem; r_action_count = r_action_count + 1;";
|
||||||
neednearby[] = {};
|
neednearby[] = {};
|
||||||
requiretools[] = {"ItemToolbox","ItemMatchbox"};
|
requiretools[] = {"ItemToolbox","ItemMatchbox"};
|
||||||
output[] = {{"ItemFireBarrel_kit",1}};
|
output[] = {{"ItemFireBarrel_kit",1}};
|
||||||
input[] = {{"ItemFuelBarrelEmpty",1},{"ItemJerryCan",1},{"PartWoodPile",4}};
|
input[] = {{"ItemFuelBarrelEmpty",1},{"ItemJerryCan",1},{"PartWoodPile",4}};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_24" call dayz_rollingMessages;};
|
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_24" call dayz_rollingMessages;};
|
||||||
DZE_ActionInProgress = true;
|
DZE_ActionInProgress = true;
|
||||||
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
|
private ["_vehicle","_canSize","_configVeh","_capacity","_nameType","_curFuel","_newFuel","_dis","_sfx","_fueling","_array","_cantype",
|
||||||
"_emptycan","_isMan","_isAnimal","_isZombie","_started","_finished","_animState","_isRefuel"];
|
"_emptycan","_started","_finished","_animState","_isRefuel"];
|
||||||
|
|
||||||
_vehicle = cursorTarget;
|
|
||||||
_array = _this select 3;
|
_array = _this select 3;
|
||||||
_cantype = _array select 0;
|
_cantype = _array select 0;
|
||||||
|
_vehicle = _array select 1;
|
||||||
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
|
_canSize = getNumber(configFile >> "cfgMagazines" >> _cantype >> "fuelQuantity");
|
||||||
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan");
|
_emptycan = getText(configFile >> "cfgMagazines" >> _cantype >> "emptycan");
|
||||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||||
@@ -14,11 +14,7 @@ _nameType = getText(_configVeh >> "displayName");
|
|||||||
_curFuel = ((fuel _vehicle) * _capacity);
|
_curFuel = ((fuel _vehicle) * _capacity);
|
||||||
_newFuel = (_curFuel + _canSize);
|
_newFuel = (_curFuel + _canSize);
|
||||||
_fueling = player getVariable ["fueling",false];
|
_fueling = player getVariable ["fueling",false];
|
||||||
_isMan = _vehicle isKindOf "Man";
|
|
||||||
_isAnimal = _vehicle isKindOf "Animal";
|
|
||||||
_isZombie = _vehicle isKindOf "zZombie_base";
|
|
||||||
|
|
||||||
if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_refuel_notvehicle" call dayz_rollingMessages; DZE_ActionInProgress = false;};
|
|
||||||
if (fuel _vehicle == 1) exitWith {DZE_ActionInProgress = false;};
|
if (fuel _vehicle == 1) exitWith {DZE_ActionInProgress = false;};
|
||||||
|
|
||||||
player removeAction s_player_fillfuel + _capacity;
|
player removeAction s_player_fillfuel + _capacity;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort",
|
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort",
|
||||||
"_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText",
|
"_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText",
|
||||||
"_availableCansEmpty","_hasHose","_PlayerNear","_isMan","_isAnimal","_isZombie"];
|
"_availableCansEmpty","_hasHose","_PlayerNear"];
|
||||||
|
|
||||||
|
_vehicle = _this select 3;
|
||||||
player removeAction s_player_siphonfuel;
|
player removeAction s_player_siphonfuel;
|
||||||
_hasHose = "equip_hose" in magazines player;
|
_hasHose = "equip_hose" in magazines player;
|
||||||
|
|
||||||
@@ -11,18 +12,12 @@ _PlayerNear = {isPlayer _x} count ((getPosATL _vehicle) nearEntities ["CAManBase
|
|||||||
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||||
|
|
||||||
dayz_siphonFuelInProgress = true;
|
dayz_siphonFuelInProgress = true;
|
||||||
_vehicle = _this select 3;
|
|
||||||
_abort = false;
|
_abort = false;
|
||||||
|
|
||||||
// Static vehicle fuel information
|
// Static vehicle fuel information
|
||||||
_configVeh = configFile >> "cfgVehicles" >> typeOf _vehicle;
|
_configVeh = configFile >> "cfgVehicles" >> typeOf _vehicle;
|
||||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||||
_nameText = getText(_configVeh >> "displayName");
|
_nameText = getText(_configVeh >> "displayName");
|
||||||
_isMan = _vehicle isKindOf "Man";
|
|
||||||
_isAnimal = _vehicle isKindOf "Animal";
|
|
||||||
_isZombie = _vehicle isKindOf "zZombie_base";
|
|
||||||
|
|
||||||
if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_siphon_notvehicle" call dayz_rollingMessages; };
|
|
||||||
|
|
||||||
// Loop to find containers that can could hold fuel and fill them
|
// Loop to find containers that can could hold fuel and fill them
|
||||||
{
|
{
|
||||||
@@ -35,7 +30,7 @@ if (_isMan or _isAnimal or _isZombie) exitWith { localize "str_siphon_notvehicle
|
|||||||
_canTypeEmpty = getText(_configCanEmpty >> "displayName");
|
_canTypeEmpty = getText(_configCanEmpty >> "displayName");
|
||||||
|
|
||||||
// Get Full can size
|
// Get Full can size
|
||||||
_canName = configName(inheritsFrom(configFile >> "cfgMagazines" >> _canNameEmpty));
|
_canName = getText(_configCanEmpty >> "fullCan");
|
||||||
_canSize = getNumber(configFile >> "cfgMagazines" >> _canName >> "fuelQuantity");
|
_canSize = getNumber(configFile >> "cfgMagazines" >> _canName >> "fuelQuantity");
|
||||||
|
|
||||||
// is empty
|
// is empty
|
||||||
|
|||||||
@@ -289,10 +289,20 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (damage _cursorTarget < 1) then {
|
if (damage _cursorTarget < 1) then {
|
||||||
|
//Allow player to fill vehicle 210L
|
||||||
|
if (_hasBarrel && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
|
||||||
|
if (s_player_fillfuel210 < 0) then {
|
||||||
|
s_player_fillfuel210 = player addAction [format[localize "str_actions_medical_10",_text,"210"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelBarrel",_cursorTarget], 0, true, true, "", "'ItemFuelBarrel' in magazines player"];
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
player removeAction s_player_fillfuel210;
|
||||||
|
s_player_fillfuel210 = -1;
|
||||||
|
};
|
||||||
|
|
||||||
//Allow player to fill vehicle 20L
|
//Allow player to fill vehicle 20L
|
||||||
if ((_hasFuel20 or _hasBarrel) && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
|
if (_hasFuel20 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
|
||||||
if (s_player_fillfuel20 < 0) then {
|
if (s_player_fillfuel20 < 0) then {
|
||||||
s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan"], 0, true, true, "", "(('ItemJerrycan' in magazines player) or ('ItemFuelBarrel' in magazines player))"];
|
s_player_fillfuel20 = player addAction [format[localize "str_actions_medical_10",_text,"20"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemJerrycan",_cursorTarget], 0, true, true, "", "'ItemJerrycan' in magazines player"];
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
player removeAction s_player_fillfuel20;
|
player removeAction s_player_fillfuel20;
|
||||||
@@ -300,9 +310,9 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Allow player to fill vehicle 5L
|
//Allow player to fill vehicle 5L
|
||||||
if (_hasFuel5 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling}) then {
|
if (_hasFuel5 && {!_isZombie} && {!_isAnimal} && {!_isMan} && {_isVehicle or _isGenerator} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) then {
|
||||||
if (s_player_fillfuel5 < 0) then {
|
if (s_player_fillfuel5 < 0) then {
|
||||||
s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan"], 0, true, true, "", "'ItemFuelcan' in magazines player"];
|
s_player_fillfuel5 = player addAction [format[localize "str_actions_medical_10",_text,"5"], "\z\addons\dayz_code\actions\refuel.sqf",["ItemFuelcan",_cursorTarget], 0, true, true, "", "'ItemFuelcan' in magazines player"];
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
player removeAction s_player_fillfuel5;
|
player removeAction s_player_fillfuel5;
|
||||||
@@ -325,6 +335,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
s_player_siphonfuel = -1;
|
s_player_siphonfuel = -1;
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
player removeAction s_player_fillfuel210;
|
||||||
|
s_player_fillfuel210 = -1;
|
||||||
player removeAction s_player_fillfuel20;
|
player removeAction s_player_fillfuel20;
|
||||||
s_player_fillfuel20 = -1;
|
s_player_fillfuel20 = -1;
|
||||||
player removeAction s_player_fillfuel5;
|
player removeAction s_player_fillfuel5;
|
||||||
@@ -1017,6 +1029,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
|
|||||||
player removeAction s_player_studybody;
|
player removeAction s_player_studybody;
|
||||||
s_player_studybody = -1;
|
s_player_studybody = -1;
|
||||||
//fuel
|
//fuel
|
||||||
|
player removeAction s_player_fillfuel210;
|
||||||
|
s_player_fillfuel210 = -1;
|
||||||
player removeAction s_player_fillfuel20;
|
player removeAction s_player_fillfuel20;
|
||||||
s_player_fillfuel20 = -1;
|
s_player_fillfuel20 = -1;
|
||||||
player removeAction s_player_fillfuel5;
|
player removeAction s_player_fillfuel5;
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ dayz_resetSelfActions = {
|
|||||||
s_player_flipveh = -1;
|
s_player_flipveh = -1;
|
||||||
s_player_stats = -1;
|
s_player_stats = -1;
|
||||||
s_player_sleep = -1;
|
s_player_sleep = -1;
|
||||||
|
s_player_fillfuel210 = -1;
|
||||||
s_player_fillfuel20 = -1;
|
s_player_fillfuel20 = -1;
|
||||||
s_player_fillfuel5 = -1;
|
s_player_fillfuel5 = -1;
|
||||||
s_player_siphonfuel = -1;
|
s_player_siphonfuel = -1;
|
||||||
|
|||||||
@@ -1349,22 +1349,6 @@
|
|||||||
<French>Un tuyau serait nécessaire pour ce faire.</French>
|
<French>Un tuyau serait nécessaire pour ce faire.</French>
|
||||||
<German>Dafür brauchst du einen Schlauch.</German>
|
<German>Dafür brauchst du einen Schlauch.</German>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="str_siphon_notvehicle">
|
|
||||||
<English>You can only siphon the fuel from a vehicle!</English>
|
|
||||||
<Russian>Сливать топливо можно только из транспорта!</Russian>
|
|
||||||
<Spanish>Sólo se puede desviar el combustible de un vehículo!</Spanish>
|
|
||||||
<Czech>Palivo lze přečerpávat pouze z vozidla!</Czech>
|
|
||||||
<French>Vous ne pouvez siphonner du carburant que d'un véhicule!</French>
|
|
||||||
<German>Du kannst nur aus einem Fahrzeug Treibstoff abzapfen.</German>
|
|
||||||
</Key>
|
|
||||||
<Key ID="str_refuel_notvehicle">
|
|
||||||
<English>You can only refuel a vehicle!</English>
|
|
||||||
<Russian>Заправлять можно только транспорт!</Russian>
|
|
||||||
<Spanish>Sólo se puede repostar un vehículo!</Spanish>
|
|
||||||
<Czech>Můžete dotankovat pouze vozidla!</Czech>
|
|
||||||
<French>Vous ne pouvez faire le plein que d'un véhicule!</French>
|
|
||||||
<German>Du kannst nur ein Fahrzeug auftanken.</German>
|
|
||||||
</Key>
|
|
||||||
<Key ID="str_setFireMatches">
|
<Key ID="str_setFireMatches">
|
||||||
<English>Unable to set on fire, missing matches.</English>
|
<English>Unable to set on fire, missing matches.</English>
|
||||||
<Russian>Нечем разжечь огонь. Может найти спички?</Russian>
|
<Russian>Нечем разжечь огонь. Может найти спички?</Russian>
|
||||||
|
|||||||
Reference in New Issue
Block a user