Jump to page content
English English   Polish Polish   Dutch Dutch   Russian Russian   German German   Hungarian Hungarian   Norwegian Norwegian   Swedish Swedish   Finnish Finnish   Romanian Romanian   Spanish Spanish   Portuguese Portuguese   Latvian Latvian  
Homepage
Home
Register
Login

Resources
Forum
Wiki
Servers

rssCar Fuel System (fuel)

Category:script
Author(s):Alan.Alexander
Downloads:9968
Rate:You need to be logged in to vote
Rating:3.8 (48 Votes)
Description:
Video: youtu.be/T7NcP830Kwo <-- Credits to LeetWoovie for being awesome enough to agree to making this.

NOTE: This resource is still a bit rough around the edges.

Description:-
A fairly basic fuel system for cars and bikes, if you wanna make it for planes and shit as well, feel free, the code is fairly straight-foward.

Commands:-
/syphon - While standing next to a car and looking at it, you can enter this command to start syphoning fuel, the amount a player can hold is determined by the "-1" ID in carData.xml.
/refuel - Much like the syphon command, but you can give a car fuel instead of taking it.

Features:-
To refuel a car, drive it into a marker for a garage and then a timer will be triggered to make sure you stay in there for at least 1.5 seconds, after that, a kind of loop will begin to start incrementally refueling you car on a 0.5 second basis.
A fuel gauge done completely in DX functions to the right side, changes from green to red as it lowers.
An "/engine" function to turn the engine on and off, as staying idle still uses fuel.
Has an XML file that contains the "fuel tank size" of any car model you want, with a default (ID "0") for cars, and ID "-1" being used for a players capacity.
Contains an XML file for garages, just use the one there as a base for any you want to add in, I will get them all mapped out at some point.

To do list:-
Change animations for syphoning and refueling cars.
Add in a gauge for how much fuel a player has.

Known issues:-
Fuel consumption is stopped when the resource is restarted, my advice to you, exit the car and then re-enter, or just don't restart it! =D
Messages aren't limited properly to just one player.

Ideas for what YOU can do with this:-
You could make this into a business script where the garage owners can collect the money from the fuel purchases.
You can also make it so that garages have a limited amount of fuel and a garage owner needs to put an order in and then the owner would need pick up a tanker and take it to their garage to fill it up.


I'm looking for any input/ideas, and most importantly, any bugs. ^_^ Enjoy.
...

(more)

Download latest version | Report

Version history

Version Publish Date Changes
0.9.0 2012-07-26 17:57:18 Fixed the amount of fuel a car has once it respawn (from an explosion or just being idle).
Added a wee health bar next to the fuel bar.
All garages (that I know about) are now added into the garageData.xml file.
Download
0.7.8 2011-12-09 12:59:16 Fixed a minor bug, took out the shitty image as I didn't like it. Download
0.7.5 2011-12-04 22:53:19 Took out the text properly this time.
Added in a shitty image to indicate that it's a fuel gauge.
Download
0.7.0 2011-12-04 22:28:23 Changed teh way refueling is done. Took out text to display how much fuel left, only gauge now. Download
0.6.0 2011-12-03 14:57:11 Changed the way fuel depletion was calculated.
Fixed a minor bug.
Download
0.1.5 2011-12-03 06:06:40 First public release Download