UPDATED DayZ And DayZ Epoch Autorefuel all fuel pumps work and the ones that need power

if any one no's the name of fuel pumps at air ports let me no then ill update script

  • help on air port fuel pumps names or ids

    Votes: 0 0.0%

  • Total voters
    7
1. Open the PBO's in PBOview or any other program that you prefer.

2. Upack the mission.pbo (Which you download from dayz.st/advanced settings/get default)

3. Open init.sqf with notepad++ and replace line

if (!isDedicated) then {

with

if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";

4. Save your changes

5. Create folder named "Scripts" inside the dayz_mission folder (dayz_mission\Scripts)

6.create two new empty note pad ++ documents called kh_actions.sqf and kh_vehicle_refuel.sqf to your new scripts folder add .sqf to the end of the save ass name and select all file types example save ass (kh_actions.sqf) then select all file types then save

7. copy and paste this in kh_actions.sqf


private ["_vehicle", "_vehicle_refuel_id"];
//Awesomely Edited by Stephen, Then modified by Me
_vehicle = objNull;
diag_log "Running ""kh_actions"".";
_distance = 15; // Distance from object to display Refuel Message
_amount= 0.02; // Amount of fuel to add per loop. Default was 0.005
while {true} do
{
if (!isNull player) then {
private ["_currentVehicle", "_isNearFeed", "_countFuel"];
_currentVehicle = vehicle player;
_countFuel = (count ((position _currentVehicle) nearObjects ["Land_Fuel_tank_big", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_A_FuelStation_Feed", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_Ind_TankSmall2_EP1", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuel_tank_stairs", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["FuelPump_DZ", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_benzina_schnell", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["land_fuelstation_w", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuelstation_army", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_wagon_tanker", _distance]));
_isNearFeed = _countFuel > 0;
if (_vehicle != _currentVehicle) then {
if (!isNull _vehicle) then {
_vehicle removeAction _vehicle_refuel_id;
_vehicle = objNull;
};
if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then { //change "Bicycle" to "Land" to allow only air vehicles to aut-refuel
_vehicle = _currentVehicle;
_vehicle_refuel_id = _vehicle addAction ["Refuel", "Scripts\kh_vehicle_refuel.sqf", [_amount], -1, false, true, "", "vehicle _this == _target && local _target"];
};
};

if (!_isNearFeed) then {
_vehicle removeAction _vehicle_refuel_id;
_vehicle = objNull;
};
};
sleep 2;
}


8.then copy and paste this in kh_vehicle_refuel.sqf


private ["_target", "_caller", "_id"];
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_args = _this select 3;
_amount = _args select 0;
if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; };
if (!ib_refueling_in_progress) then {
ib_refueling_in_progress = true;
titleText ["Refueling", "PLAIN DOWN", 3];
while {(vehicle _caller == _target) and (local _target)} do {
private ["_velocity", "_cfcust"];

_velocity = velocity _target;
_cfcust = fuel _target;
if ((_velocity select 0 > 1) or (_velocity select 1 > 1) or (_velocity select 2 > 1)) exitWith {
titleText ["Refueling Stopped", "PLAIN DOWN", 3];
};
if (_cfcust >= 1.0) exitWith {
titleText ["Done Refueling", "PLAIN DOWN", 3];
};
sleep 0.5;
_cfcust = _cfcust + _amount;
if (_cfcust >= 1.0) then { _cfcust = 1.0; };
_target setFuel _cfcust;
};
titleFadeOut 1;
ib_refueling_in_progress = false;
};

8. Re-pack the file with PBOview

9. Upload the newly made PBO file to the server using the control panel on dayz.st site.

10. Edit the file BattlEye/scripts.txt (hint, use FTP Client to access the scripts.txt) This is vital to prevent players getting kicked for restrictions!

Add this line as the last line:
5 setFuel !"\"setFuel\"," !"z\addons\dayz_code\compile\local_setFuel.sqf" !"\"dayzSetFuel\"" !"dayzSetFuel_code" !"dayzSetFuel = _val;" !"Scripts\kh_actions.sqf" !"Scripts\kh_vehicle_refuel.sqf"

this is fully working on my server with battle eye and loads of other scripts and you do not need to white list this script for antihack
 
Last edited:
After this
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_wagon_tanker", _distance]));

Add this to get all pumps working
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuelstation_army", _distance]));
_countFuel = _countFuel + (count ((position _currentVehicle) nearObjects ["Land_fuelstation", _distance]));
 
Last edited:
Back
Top