diff --git a/bridge/qb/server/main.lua b/bridge/qb/server/main.lua index 7613dde39..667221d9c 100644 --- a/bridge/qb/server/main.lua +++ b/bridge/qb/server/main.lua @@ -3,10 +3,8 @@ if GetConvar('qbx:enablebridge', 'true') == 'false' then return end require 'bridge.qb.server.debug' require 'bridge.qb.server.events' -CreateThread(function() - local convertItems = require 'bridge.qb.shared.compat'.convertItems - convertItems(require '@ox_inventory.data.items', require 'shared.items') -end) +local convertItems = require 'bridge.qb.shared.compat'.convertItems +convertItems(require '@ox_inventory.data.items', require 'shared.items') qbCoreCompat = {} diff --git a/bridge/qb/shared/compat.lua b/bridge/qb/shared/compat.lua index 3da3f4e4a..c93d9e663 100644 --- a/bridge/qb/shared/compat.lua +++ b/bridge/qb/shared/compat.lua @@ -91,8 +91,11 @@ return { file[fileSize+1] = '}' SaveResourceFile('ox_inventory', 'data/items.lua', table.concat(file), -1) - print('^2[warning]^7 '..count..' items have been added to ox_inventory') - print('^2[warning]^7 You MUST restart the resource to load the new items.') + CreateThread(function() + Wait(1000) + print('^2[warning]^7 '..count..' items have been added to ox_inventory') + print('^2[warning]^7 You MUST restart the resource to load the new items.') + end) end end } diff --git a/server/main.lua b/server/main.lua index 535399e1f..773f97a2c 100644 --- a/server/main.lua +++ b/server/main.lua @@ -1,5 +1,20 @@ lib.versionCheck('Qbox-project/qbx_core') -assert(lib.checkDependency('ox_lib', '3.20.0', true)) +local startupErrors, errorMessage +if not lib.checkDependency('ox_lib', '3.20.0', true) then + startupErrors, errorMessage = true, 'ox_lib version 3.20.0 or higher is required' +elseif not lib.checkDependency('ox_inventory', '2.42.0', true) then + startupErrors, errorMessage = true, 'ox_inventory version 2.42.0 or higher is required' +elseif GetConvar('inventory:framework', '') ~= 'qbx' then + startupErrors, errorMessage = true, 'inventory:framework must be set to "qbx" in order to use qbx_core' +end +if startupErrors then + lib.print.error('Startup errors detected, shutting down server...') + ExecuteCommand('quit immediately') + for _ = 1, 100 do + lib.print.error(errorMessage) + end + error(errorMessage) +end ---@type 'strict'|'relaxed'|'inactive' local bucketLockDownMode = GetConvar('qbx:bucketlockdownmode', 'inactive')