Jump to content
  • 0

error in fill canisters


totis

Question

Hi guys.

I have this error in self actions when i try to refuel canisters from tanks

error undefenided variable in expression : a_player_jerryfilling.

My code:

Quote

    //Allow player to fill Fuel can
    if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling} && {_isAlive}) then {
        if (s_player_fillfuel < 0) then {
            s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",_cursorTarget, 1, false, true];
        };
    } else {
        player removeAction s_player_fillfuel;
        s_player_fillfuel = -1;
    };
   
    if (damage _cursorTarget < 1) then {
        //Allow player to fill vehicle 210L
        if (_hasBarrel && {!_isMan} && {_isVehicle} && {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];
            };
        } else {
            player removeAction s_player_fillfuel210;
            s_player_fillfuel210 = -1;
        };
       
        //Allow player to fill vehicle 20L
        if (_hasFuel20 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) 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",_cursorTarget], 0, true, true];
            };
        } else {
            player removeAction s_player_fillfuel20;
            s_player_fillfuel20 = -1;
        };
 
        //Allow player to fill vehicle 5L
        if (_hasFuel5 && {!_isMan} && {_isVehicle} && {fuel _cursorTarget < 1} && {!a_player_jerryfilling} && {!_isDisallowRefuel}) 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",_cursorTarget], 0, true, true];
            };
        } else {
            player removeAction s_player_fillfuel5;
            s_player_fillfuel5 = -1;
        };
        /*
            Vanilla generator is currently not functional.
            Vanilla generator refuel actions removed for now.
            Epoch generator fill action is below.
        */
        //Allow player to siphon vehicles
        if (_hasEmptyFuelCan && {!_isMan} && {_isVehicle} && {!_isBicycle} && {!a_player_jerryfilling} && {fuel _cursorTarget > 0}) then {
            if (s_player_siphonfuel < 0) then {
                s_player_siphonfuel = player addAction [format[localize "str_siphon_start"], "\z\addons\dayz_code\actions\siphonFuel.sqf",_cursorTarget, 0, true, true];
            };
        } else {
            player removeAction s_player_siphonfuel;
            s_player_siphonfuel = -1;
        };
    } else {
        player removeAction s_player_fillfuel210;
        s_player_fillfuel210 = -1;
        player removeAction s_player_fillfuel20;
        s_player_fillfuel20 = -1;
        player removeAction s_player_fillfuel5;
        s_player_fillfuel5 = -1;
        player removeAction s_player_siphonfuel;
        s_player_siphonfuel = -1;
    };

This changed since 1.0.6.1?  im using that code

Tnx

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...