DayZ Chenarus Auto Refuel! All stations!

I modified the script that Seven posted to work with all the fuel tanks you can use with jerry cans and the gas pumps. I removed some code that wasn't needed and added messages for when the vehicle moves while fueling and when fueling is done. Added some variables to the kh_actions.sqf file (lines 6 & 7) for distance from tanks/pumps and amount of fuel per loop so it can be changed easily.

kh_actions.sqf - http://pastebin.com/rCW8sWCC
kh_vehicle_refuel.sqf - http://pastebin.com/6AmSQB8w
Hey thanks for the fix, I just implemented it and it runs great, HOWEVER, there is 1 problem.

I really like how you used to have to get out the the vehicle to fuel up, it added an element of risk, Is there any way you would be willing to modify it so it no longer works from inside the vehicle but works from outside of it?
Thanks
 
This worked perfectly, with the exception of a fuel random things, like the ability to refuel a bicycle, but that is such a minor thing that it doesn't even register as a problem. Thanks for this.

Ha.. I never even thought of a bicycle.. I updated the pastebin to reflect the change. or just change line 28 in kh_actions.sqf to:
Code:
if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then {

Hey thanks for the fix, I just implemented it and it runs great, HOWEVER, there is 1 problem.

I really like how you used to have to get out the the vehicle to fuel up, it added an element of risk, Is there any way you would be willing to modify it so it no longer works from inside the vehicle but works from outside of it?
Thanks

I could try and see what I can do.. I just started to mess with arma so I'm still learning how arma does things.
 
Ha.. I never even thought of a bicycle.. I updated the pastebin to reflect the change. or just change line 28 in kh_actions.sqf to:
Code:
if (_currentVehicle != player && _isNearFeed && !(_currentVehicle isKindof "Bicycle")) then {



I could try and see what I can do.. I just started to mess with arma so I'm still learning how arma does things.
Thanks Muddr, I am totally clueless when it comes to this stuff, I am just now trying to figure this stuff out and sadly it has taken a long time just to figure out how to get other peoples stuff to work, I'll probolly start working on learning to code, but first I'm just trying to get things to work and add in some other cool things from other people. I really appreciate the help.
 
Can someone please tell me what i am doing wroing and its not working ?
I am using Dayz Control Center for server (1.7.5.1) ...so thats where i put the scripts

\ArmA 2\MPMissions\dayz_1.chernarus\scriptsMZ
\ArmA 2\MPMissions\dayz_1.chernarus\Scripts (this is for the 2 scripts posted by Seven)
and i edited ArmA 2\MPMissions\dayz_1.chernarus\mission.sqm and added the class under the #100 vehicles
and i edited ArmA 2\MPMissions\dayz_1.chernarus\init.sqf and added the extra line for Seven script to work
and i edited ArmA 2\@dayzcc_config\1\BattlEye\scripts.txt at line 46 and did it like this:
Code:
5 setFuel !"\"setFuel\"," !"z\addons\dayz_code\compile\local_setFuel.sqf" !"\"dayzSetFuel\"" !"scriptsMZ\MZ_reload.sqf"

I brought a car and a bike at the gas station east of Chernarus, and its not refueling...Not even an error or anything.

Thanks
 
Hello there OpenDayZ friends!!

I have recently made an Auto Refuel Script, together with ALL stations already in and ready to use XD

All you need to do is drive next to a pump, the cars engine is then turned off and then fills up from however much fuel there is! It does not unrealistically drain and then start fueling, like some other scripts!
It does work with helis, and no, it doesn't turn off their engine!!

This was made for bliss, but it will work with over Private Hives, just addapt it for your MPMission file :)

Instructions:
Mod your mission.sqm and add it with the lines of code provided (Add it in)
Put "scriptsMZ" in that EXACT location, or it will not work..
For BE Script Kicks Find this: "5 setFuel blahblahblah" At the end of that line add: !"scriptsMZ\MZ_reload.sqf"
Just like that

I will maintain this script and update it so please check back for updates!

Please post recommendations/requests here!

Find it here: https://github.com/MattzFiber/DayZ-Fuel-Script
Current version: 1.1
The github might look a little messy but eh, it was my first time ;)

Enjoy!

Also see some of my work here:
http://opendayz.net/index.php?threads/chopper-ammo-refuel.7070/
Working great thank you i use both your fuel scripts on my sever
 
Can someone please tell me what i am doing wroing and its not working ?
I am using Dayz Control Center for server (1.7.5.1) ...so thats where i put the scripts

\ArmA 2\MPMissions\dayz_1.chernarus\scriptsMZ
\ArmA 2\MPMissions\dayz_1.chernarus\Scripts (this is for the 2 scripts posted by Seven)
and i edited ArmA 2\MPMissions\dayz_1.chernarus\mission.sqm and added the class under the #100 vehicles
and i edited ArmA 2\MPMissions\dayz_1.chernarus\init.sqf and added the extra line for Seven script to work
and i edited ArmA 2\@dayzcc_config\1\BattlEye\scripts.txt at line 46 and did it like this:
Code:
5 setFuel !"\"setFuel\"," !"z\addons\dayz_code\compile\local_setFuel.sqf" !"\"dayzSetFuel\"" !"scriptsMZ\MZ_reload.sqf"

I brought a car and a bike at the gas station east of Chernarus, and its not refueling...Not even an error or anything.

Thanks

In your MPMissions\dayz_1.chernarus folder, has the .pbo been repackaged with the new script files ?
 
In your MPMissions\dayz_1.chernarus folder, has the .pbo been repackaged with the new script files ?

There is no .pbo there :/
The only .pbo that i can think of is : ArmA 2\@dayzcc\addons\dayz_server.pbo
But what do you mean repackaged (sorry i am still new to all this). I didnt see any info on the github about repacking something ? was that just something obvious which i didnt get ?
Will tool pbom do that ? (thats all i could find).
-Thanks
 
Sorry that should be: Is there a dayz_1.chernarus.pbo in your MPMissions folder. If so the game is referencing that before your folder structure. (I was on the train and doing it from memory)

You can create new .pbo files with various tools ( I think these are the official tools: http://community.bistudio.com/wiki/BI_Tools_2), I use the one that comes with the Reality (Old Bliss) Package. Look in the Dayz Private Master folder then util folder, double click on cpbo.exe. That will add a right click option to create .pbo out of a folder.

You can then right click on the dayz_1.chernarus folder and choose create PBO.. this will repackage that folder structure into the new .pbo.

During testing I delete the .pbo file, the game then references the actual folder structure..
 
Sorry that should be: Is there a dayz_1.chernarus.pbo in your MPMissions folder. If so the game is referencing that before your folder structure. (I was on the train and doing it from memory)

You can create new .pbo files with various tools ( I think these are the official tools: http://community.bistudio.com/wiki/BI_Tools_2), I use the one that comes with the Reality (Old Bliss) Package. Look in the Dayz Private Master folder then util folder, double click on cpbo.exe. That will add a right click option to create .pbo out of a folder.

You can then right click on the dayz_1.chernarus folder and choose create PBO.. this will repackage that folder structure into the new .pbo.

During testing I delete the .pbo file, the game then references the actual folder structure..

Crap yes i do have a dayz_1.chernarus.pbo right in the MPMissions folder.
So let me get this straight...I have the dayz_1.chernarus folder and the .pbo file in the MPMissions folder.
I put all the scripts etc in the folder then i delete (or backup) the orginal .pbo file and i repack the folder to create a new one....thus the game loads the new pbo file with the additions. And all that is totally irrelevant to the dayz_server.pbo located in the ArmA 2\@dayzcc\addons ?


Edit : :) It works :) Thanks man for the clarification. !
 
Players getting kicked #44 restriction with this error:

Code:
dayz_losChance = {
private["_agent","_max"
07.02.2013 21:55:55: Player (ip:port) guid - #44 "sEngineOn _object;
if (_OnOff) then
{exit;}
else {
_object setFuel fuel _object + 0.1;
sleep 6;
};
};

i have hidden the ip, port etc in the log
 
I modified the script that Seven posted to work with all the fuel tanks you can use with jerry cans and the gas pumps. I removed some code that wasn't needed and added messages for when the vehicle moves while fueling and when fueling is done. Added some variables to the kh_actions.sqf file (lines 6 & 7) for distance from tanks/pumps and amount of fuel per loop so it can be changed easily.

kh_actions.sqf - http://pastebin.com/rCW8sWCC
kh_vehicle_refuel.sqf - http://pastebin.com/6AmSQB8w

All my users get kicked with script error 44 / 45 even after i've removed the line..
 
Add this to your setFuel on the scripts.txt
Code:
 !"Scripts\kh_actions.sqf" !"Scripts\kh_vehicle_refuel.sqf"

Should look something like this..
Code:
5 setFuel !"\"setFuel\"," !"z\addons\dayz_code\compile\local_setFuel.sqf" !"dayzSetFuel" !"dayzSetFuel_code" !"Scripts\kh_actions.sqf" !"Scripts\kh_vehicle_refuel.sqf"
 
Ah, I added the other. no worries I removed the line now :p
and found that the other error might have been additonal spaces in the line (a BE error, not mine)

Thanks for the quick reply :)
 
To the one who originally had the idea, HUGE PROPS, to you guys who made it easy for all of us to work with, you guys are INCREDIBLE and have my gratitude!

US 1505
 
About 1 or 2 bars per second... Seems realistic enough for my players :)
I'm talking about "Sevens" version .. The other one was a little bloated and too fast for my liking!

Edited: Got the guys name wrong, it's correct now though :p
 
Personally I like Sevens version as it doesn't require entries in the mission.sqm. If that is the one you are referring to (with kh_vehicle_Refuel.sqf), in that file there are two lines (#34 & #36):
Code:
sleep 0.5;
 
_cfcust = _cfcust + 0.005;
The first is the time to sleep inbetween each 'glug' of fuel going in, the second is how big the 'glug' is, adjust to suit your needs.. I agree with UrbanSkaters, both bits of code have the speed about right. What I would like to see added would be this:
Code:
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
Have noticed this in a few of the dayz_code files, notably build.sqf and the tent pitching code, I haven't tested this but, looking here, this appears to alert zeds, within a radius, to your presence..
 
Back
Top