Seven posted a script in a thread but I am getting kicked when I use it. Does anybody know how to remove the kick?
Can't post links so I'll just add the lat part of the URL.
dayz-chenarus-auto-refuel-all-stations.7056/page-4
Can't post links so I'll just add the lat part of the URL.
dayz-chenarus-auto-refuel-all-stations.7056/page-4
why is everyone making this so hard for them selves having to add extra objects to their mission file. I use a script that brings a refuel scroll wheel option up when you are near a pump, all it requires is a single line added to the init.sqf. I could easily modify it to be automatic.
add this code after "if (!isDedicated) then {" in your missions init.sqf
PHP:[] execVM "Scripts\kh_actions.sqf";
Then make a folder called "Scripts" and add these two files
kh_actions.sqf
PHP:private ["_vehicle", "_vehicle_refuel_id"]; //Awesomely Edited by Seven _vehicle = objNull; diag_log "Running ""kh_actions""."; while {true} do { if (!isNull player) then { private ["_currentVehicle", "_isNearFeed"]; _currentVehicle = vehicle player; _isNearFeed = count ((position _currentVehicle) nearObjects ["Land_A_FuelStation_Feed", 10]) > 0; if (_vehicle != _currentVehicle) then { if (!isNull _vehicle) then { _vehicle removeAction _vehicle_refuel_id; _vehicle = objNull; }; if (_currentVehicle != player && _isNearFeed) then { _vehicle = _currentVehicle; _vehicle_refuel_id = _vehicle addAction ["Refuel", "Scripts\kh_vehicle_refuel.sqf", [], -1, false, false, "", "vehicle _this == _target && local _target"]; }; }; if (!_isNearFeed) then { _vehicle removeAction _vehicle_refuel_id; _vehicle = objNull; }; }; sleep 2; }
kh_vehicle_refuel.sqf
PHP:private ["_target", "_caller", "_id", "_isNearFeed"]; _target = _this select 0; _caller = _this select 1; _id = _this select 2; if (isNil "ib_refueling_in_progress") then { ib_refueling_in_progress = false; }; if (!ib_refueling_in_progress) then { _isNearFeed = count ((position _caller) nearObjects ["Land_A_FuelStation_Feed", 10]) > 0; if (!_isNearFeed) then { titleText ["You must be near a fuel station pump.", "PLAIN DOWN", 3]; titleFadeOut 3; } else { ib_refueling_in_progress = true; titleText ["Refueling", "PLAIN", 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 { }; if (_cfcust >= 1.0) exitWith { }; sleep 0.5; _cfcust = _cfcust + 0.005; if (_cfcust >= 1.0) then { _cfcust = 1.0; }; _target setFuel _cfcust; }; titleFadeOut 1; ib_refueling_in_progress = false; }; };