Skip to main content

GetFuel

exports["RiP-Fuel"]:GetFuel(vehicle) 

This function returns the vehicle's fuel level

Arguments

NameTypeOptionalExplenation
vehicleNoVehicle to get fuel level

Returned Integer

The action returns the vehicle's fuel level.

Example

local vehicle = ESX.Game.GetVehicleInDirection()

if DoesEntityExist(vehicle) then
local fuel = exports["RiP-Fuel"]:GetFuel(vehicle)
if fuel then
print("Fuel level: "..fuel)
end
end