Fuel.GetFuelName

This commit is contained in:
MrNewb committed 2025-04-19 14:36:10 -04:00
1 parent 7d43d65058
commit 2fb2edff9b
13 files changed
+175 -20

No files matched your search

+6
View File
@@ -1,5 +1,11 @@
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return 'default'
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
+13 -2
View File
@@ -2,15 +2,26 @@ local resourceName = "BigDaddy-Fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading BigDaddy-Fuel")
--if GetResourceState('BigDaddy-Fuel') ~= 'started' then return end
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['BigDaddy-Fuel']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
exports['BigDaddy-Fuel']:SetFuel(vehicle, fuel)
+14 -2
View File
@@ -1,15 +1,27 @@
local resourceName = "cdn-fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
----print("Fuel: Loading cdn-fuel")
--if GetResourceState('cdn-fuel') ~= 'started' then return end
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['cdn-fuel']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
return exports['cdn-fuel']:SetFuel(vehicle, fuel)
+15 -3
View File
@@ -1,16 +1,28 @@
local resourceName = "esx-sna-fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading esx-sna-fuel")
--if GetResourceState('esx-sna-fuel') ~= 'started' then return end
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['esx-sna-fuel']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
exports['esx-sna-fuel']:SetFuel(vehicle, fuel)
end
end
+15 -4
View File
@@ -1,17 +1,28 @@
local resourceName = "lc_fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading lc_fuel")
if GetResourceState('lc_fuel') ~= 'started' then return end
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports["lc_fuel"]:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return exports["lc_fuel"]:SetFuel(vehicle, fuel)
end
end
+13 -1
View File
@@ -1,15 +1,27 @@
local resourceName = "LegacyFuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading LegacyFuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['LegacyFuel']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return exports['LegacyFuel']:SetFuel(vehicle, fuel)
+14 -1
View File
@@ -1,14 +1,27 @@
local resourceName = "okokGasStation"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading okokGasStation")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['okokGasStation']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return exports['okokGasStation']:SetFuel(vehicle, fuel)
+14 -1
View File
@@ -1,14 +1,27 @@
local resourceName = "ox_fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading ox_fuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return Entity(vehicle).state.fuel
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
local currentFuel = Entity(vehicle).state.fuel
+14 -1
View File
@@ -1,14 +1,27 @@
local resourceName = "ps-fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading ps-fuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports["ps-fuel"]:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return exports["ps-fuel"]:SetFuel(vehicle, fuel)
+15 -2
View File
@@ -1,15 +1,28 @@
local resourceName = "qs-fuelstations"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading qs-fuelstations")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['qs-fuelstations']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
return exports['qs-fuelstations']:SetFuel(vehicle, fuel)
end
end
+14 -1
View File
@@ -1,14 +1,27 @@
local resourceName = "Renewed-Fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading Renewed-Fuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
return exports['Renewed-Fuel']:GetFuel(vehicle)
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel, type)
if not DoesEntityExist(vehicle) then return end
return exports['Renewed-Fuel']:SetFuel(vehicle, fuel)
+14 -1
View File
@@ -1,15 +1,28 @@
local resourceName = "ti_fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading ti_fuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
local level, _ = exports["ti_fuel"]:getFuel(vehicle)
return level
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
return exports['ti_fuel']:setFuel(vehicle, fuel, "RON91")
+14 -1
View File
@@ -1,15 +1,28 @@
local resourceName = "x-fuel"
local configValue = BridgeClientConfig.Fuel
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Fuel: Loading x-fuel")
Fuel = Fuel or {}
---This will get the name of the Fuel being used (if a supported Fuel).
---@return string
Fuel.GetFuelName = function()
return resourceName
end
---This will get the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@return number fuel The fuel level of the vehicle.
Fuel.GetFuel = function(vehicle)
if not DoesEntityExist(vehicle) then return 0.0 end
local level, _ = exports["x-fuel"]:getFuel(vehicle)
return level
end
---This will set the fuel level of the vehicle.
---@param vehicle number The vehicle entity ID.
---@param fuel number The fuel level to set.
---@return nil
Fuel.SetFuel = function(vehicle, fuel)
if not DoesEntityExist(vehicle) then return end
return exports['x-fuel']:SetFuel(vehicle, fuel)