Change how bridge decides what get/setvehicleproperties to use

This commit is contained in:
Jim Shield
2024-01-19 22:33:35 +00:00
committed by GitHub
parent b0b011ac56
commit 7d0736bfc2

View File

@@ -923,10 +923,10 @@ end
function getVehicleProperties(vehicle)
local properties = {}
if vehicle == nil then return nil end
if GetResourceState(OXLibExport):find("start") then
properties = lib.getVehicleProperties(vehicle)
elseif GetResourceState(QBExport):find("start") then
if GetResourceState(QBExport):find("start") and not GetResourceState(QBXExport):find("start") then
properties = Core.Functions.GetVehicleProperties(vehicle)
elseif GetResourceState(OXLibExport):find("start") then
properties = lib.getVehicleProperties(vehicle)
end
return properties
end
@@ -936,11 +936,11 @@ function setVehicleProperties(vehicle, props)
print(("Unable to set vehicle properties for '%s' (entity does not exist)"):
format(vehicle))
end
if GetResourceState(OXLibExport):find("start") then
TriggerServerEvent(GetCurrentResourceName()..":ox:setVehicleProperties", VehToNet(vehicle), props)
elseif GetResourceState(QBExport):find("start") then
if GetResourceState(QBExport):find("start") and not GetResourceState(QBXExport):find("start") then
if Config.System.Debug then print("^6Bridge^7: ^2Setting Vehicle Properties ^7[^6"..QBExport.."^7] - [^3"..vehicle.."^7] - [^3"..GetEntityModel(vehicle).."^7] - [^3"..props.plate.."^7]") end
Core.Functions.SetVehicleProperties(vehicle, props)
else
TriggerServerEvent(GetCurrentResourceName()..":ox:setVehicleProperties", VehToNet(vehicle), props)
end
end