-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
I'll do this later... Too lazy right now. | ||
### About | ||
Started off as my first script, and for whatever reason, I decided to release the disguisting pile of shit. Felt bad after some time for leaving so many people with this horror of a script, so ended up spending a few hours rewriting it, so here you go. (: | ||
|
||
### Installation | ||
1) Download the latest version in the "code" tab on GitHub. | ||
2) Drag & drop the folder in your `resources` server folder. | ||
3) Configure the config file to your liking. | ||
4) Add `start LegacyFuel` to your server config. | ||
|
||
### Exports | ||
There are currently two exports available, which should help you control the fuel level for vehicles whenever needed. | ||
|
||
``` | ||
SetFuel(--[[Vehicle--]] vehicle, --[[Int--]] value) | ||
GetFuel(--[[Vehicle--]] vehicle) -- Returns the vehicle's fuel level. | ||
``` | ||
|
||
**Example usage:** | ||
``` | ||
function SpawnVehicle(modelHash) | ||
local vehicle = CreateVehicle(modelHash, coords.x, coords.y, coords.z, true, false) | ||
exports["LegacyFuel"]:SetFuel(vehicle, 100) | ||
end | ||
function StoreVehicleInGarage(vehicle) | ||
local plate = GetVehicleNumberPlateText(vehicle) | ||
local fuelLevel = exports["LegacyFuel"]:GetFuel(vehicle) | ||
TriggerServerEvent('vehiclesStored', plate, fuel) | ||
end | ||
``` |