Merge branch 'dev' of https://github.com/The-Order-Of-The-Sacred-Framework/community_bridge into dev
This commit is contained in:
commit
b9842eedfe
20 files changed
+191
-18
No files matched your search
+1
-1
@@ -4,7 +4,7 @@ lua54 'yes'
|
|||||||
use_experimental_fxv2_oal 'yes'
|
use_experimental_fxv2_oal 'yes'
|
||||||
author 'The Order of the Sacred Framework'
|
author 'The Order of the Sacred Framework'
|
||||||
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
|
description 'A bridge made for the community to use as a base for their own projects. This bridge will allow a single format to work with nearly all commonly used systems while still offering expandability.'
|
||||||
version '0.5.0'
|
version '0.5.1'
|
||||||
|
|
||||||
shared_scripts {
|
shared_scripts {
|
||||||
'@ox_lib/init.lua',
|
'@ox_lib/init.lua',
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ if GetResourceState('doors_creator') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will get the closest door to the ped
|
||||||
|
---@return string | nil
|
||||||
Doorlock.GetClosestDoor = function()
|
Doorlock.GetClosestDoor = function()
|
||||||
return exports["doors_creator"]:getClosestActiveDoor()
|
return exports["doors_creator"]:getClosestActiveDoor()
|
||||||
end
|
end
|
||||||
@@ -2,6 +2,10 @@ if GetResourceState('ox_doorlock') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will toggle the lock status of the door.
|
||||||
|
---@param doorID string
|
||||||
|
---@param toggle boolean
|
||||||
|
---@return boolean
|
||||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||||
local state = toggle
|
local state = toggle
|
||||||
if state then
|
if state then
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ if GetResourceState('qb-doorlock') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will get the closest door to the ped
|
||||||
|
---@return string | nil
|
||||||
Doorlock.GetClosestDoor = function()
|
Doorlock.GetClosestDoor = function()
|
||||||
local closestDoor = exports["qb-doorlock"]:GetClosestDoor()
|
local closestDoor = exports["qb-doorlock"]:GetClosestDoor()
|
||||||
if Table.CheckPopulated(closestDoor) then return closestDoor end
|
if Table.CheckPopulated(closestDoor) then return closestDoor end
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ if GetResourceState('qb-doorlock') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will toggle the lock status of the door.
|
||||||
|
---@param doorID string
|
||||||
|
---@param toggle boolean
|
||||||
|
---@return boolean
|
||||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||||
TriggerClientEvent('qb-doorlock:client:setState', -1, 0, doorID, toggle, false, false, false)
|
TriggerClientEvent('qb-doorlock:client:setState', -1, 0, doorID, toggle, false, false, false)
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ if GetResourceState('rcore_doorlock') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will get the closest door to the ped
|
||||||
|
---@return string | nil
|
||||||
Doorlock.GetClosestDoor = function()
|
Doorlock.GetClosestDoor = function()
|
||||||
local allDoors = exports.rcore_doorlock:getLoadedDoors()
|
local allDoors = exports.rcore_doorlock:getLoadedDoors()
|
||||||
local pedCoords = GetEntityCoords(cache.ped)
|
local pedCoords = GetEntityCoords(cache.ped)
|
||||||
|
|||||||
@@ -2,6 +2,10 @@ if GetResourceState('rcore_doorlock') ~= 'started' then return end
|
|||||||
|
|
||||||
Doorlock = Doorlock or {}
|
Doorlock = Doorlock or {}
|
||||||
|
|
||||||
|
---This will toggle the lock status of the door.
|
||||||
|
---@param doorID string
|
||||||
|
---@param toggle boolean
|
||||||
|
---@return boolean
|
||||||
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
Doorlock.ToggleDoorLock = function(doorID, toggle)
|
||||||
local state = toggle
|
local state = toggle
|
||||||
if state then
|
if state then
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
Fuel = Fuel or {}
|
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.
|
---This will get the fuel level of the vehicle.
|
||||||
---@param vehicle number The vehicle entity ID.
|
---@param vehicle number The vehicle entity ID.
|
||||||
---@return number fuel The fuel level of the vehicle.
|
---@return number fuel The fuel level of the vehicle.
|
||||||
|
|||||||
@@ -2,15 +2,26 @@ local resourceName = "BigDaddy-Fuel"
|
|||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
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 {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['BigDaddy-Fuel']:GetFuel(vehicle)
|
return exports['BigDaddy-Fuel']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
exports['BigDaddy-Fuel']:SetFuel(vehicle, fuel)
|
exports['BigDaddy-Fuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
local resourceName = "cdn-fuel"
|
local resourceName = "cdn-fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
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 {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['cdn-fuel']:GetFuel(vehicle)
|
return exports['cdn-fuel']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['cdn-fuel']:SetFuel(vehicle, fuel)
|
return exports['cdn-fuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
local resourceName = "esx-sna-fuel"
|
local resourceName = "esx-sna-fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
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 {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['esx-sna-fuel']:GetFuel(vehicle)
|
return exports['esx-sna-fuel']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
exports['esx-sna-fuel']:SetFuel(vehicle, fuel)
|
exports['esx-sna-fuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,16 +1,27 @@
|
|||||||
local resourceName = "lc_fuel"
|
local resourceName = "lc_fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
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 {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports["lc_fuel"]:GetFuel(vehicle)
|
return exports["lc_fuel"]:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports["lc_fuel"]:SetFuel(vehicle, fuel)
|
return exports["lc_fuel"]:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,15 +1,27 @@
|
|||||||
local resourceName = "LegacyFuel"
|
local resourceName = "LegacyFuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading LegacyFuel")
|
|
||||||
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['LegacyFuel']:GetFuel(vehicle)
|
return exports['LegacyFuel']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['LegacyFuel']:SetFuel(vehicle, fuel)
|
return exports['LegacyFuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
local resourceName = "okokGasStation"
|
local resourceName = "okokGasStation"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading okokGasStation")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['okokGasStation']:GetFuel(vehicle)
|
return exports['okokGasStation']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['okokGasStation']:SetFuel(vehicle, fuel)
|
return exports['okokGasStation']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
local resourceName = "ox_fuel"
|
local resourceName = "ox_fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading ox_fuel")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return Entity(vehicle).state.fuel
|
return Entity(vehicle).state.fuel
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
local currentFuel = Entity(vehicle).state.fuel
|
local currentFuel = Entity(vehicle).state.fuel
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
local resourceName = "ps-fuel"
|
local resourceName = "ps-fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading ps-fuel")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports["ps-fuel"]:GetFuel(vehicle)
|
return exports["ps-fuel"]:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports["ps-fuel"]:SetFuel(vehicle, fuel)
|
return exports["ps-fuel"]:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
local resourceName = "qs-fuelstations"
|
local resourceName = "qs-fuelstations"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading qs-fuelstations")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['qs-fuelstations']:GetFuel(vehicle)
|
return exports['qs-fuelstations']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['qs-fuelstations']:SetFuel(vehicle, fuel)
|
return exports['qs-fuelstations']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
local resourceName = "Renewed-Fuel"
|
local resourceName = "Renewed-Fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading Renewed-Fuel")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
return exports['Renewed-Fuel']:GetFuel(vehicle)
|
return exports['Renewed-Fuel']:GetFuel(vehicle)
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel, type)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['Renewed-Fuel']:SetFuel(vehicle, fuel)
|
return exports['Renewed-Fuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
local resourceName = "ti_fuel"
|
local resourceName = "ti_fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading ti_fuel")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
local level, _ = exports["ti_fuel"]:getFuel(vehicle)
|
local level, _ = exports["ti_fuel"]:getFuel(vehicle)
|
||||||
return level
|
return level
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['ti_fuel']:setFuel(vehicle, fuel, "RON91")
|
return exports['ti_fuel']:setFuel(vehicle, fuel, "RON91")
|
||||||
|
|||||||
@@ -1,15 +1,28 @@
|
|||||||
local resourceName = "x-fuel"
|
local resourceName = "x-fuel"
|
||||||
local configValue = BridgeClientConfig.Fuel
|
local configValue = BridgeClientConfig.Fuel
|
||||||
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
|
||||||
--print("Fuel: Loading x-fuel")
|
|
||||||
Fuel = Fuel or {}
|
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)
|
Fuel.GetFuel = function(vehicle)
|
||||||
if not DoesEntityExist(vehicle) then return 0.0 end
|
if not DoesEntityExist(vehicle) then return 0.0 end
|
||||||
local level, _ = exports["x-fuel"]:getFuel(vehicle)
|
local level, _ = exports["x-fuel"]:getFuel(vehicle)
|
||||||
return level
|
return level
|
||||||
end
|
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)
|
Fuel.SetFuel = function(vehicle, fuel)
|
||||||
if not DoesEntityExist(vehicle) then return end
|
if not DoesEntityExist(vehicle) then return end
|
||||||
return exports['x-fuel']:SetFuel(vehicle, fuel)
|
return exports['x-fuel']:SetFuel(vehicle, fuel)
|
||||||
|
|||||||
Reference in new issue
Block a user