diff --git a/starter.lua b/starter.lua index c183ad7..e1bd995 100644 --- a/starter.lua +++ b/starter.lua @@ -30,7 +30,15 @@ Exports = { -- Required variables debugMode = Config.System.Debug --- Check server convars for hard set defaults +-- Testing a new check for new inventory, otherwise it will use the old calls for qb-inv +-- It's messy, and doesn't take in to account if you have text in the version like "beta" +local qbInvVer = GetResourceMetadata(Exports.QBInv, 'version', nil):gsub("%.", "") +QBInvNew = tonumber(qbInvVer) >= 200 -- if your qb inv version is 2.0.0 or above, then its classed as "new" + +InventoryWeight = 120000 + +-- [[ Server.Cfg Convar Check ]]-- +-- Check server convars for hard set defaults, otherwise it uses per script configurations if Config and Config.System then if Config.System.Debug then if GetConvar("jim_DisableDebug", "false") == "true" then @@ -52,28 +60,28 @@ if Config and Config.System then end end -QBInvNew = true - -InventoryWeight = 120000 - -- Testing loading the core files here instead of in fxmanifests ---for k, v in pairs({ -- This is a specific load order --- [Exports.OXLibExport] = "init.lua", --- [Exports.OXCoreExport] = "lib/init.lua", --- [Exports.ESXExport] = "imports.lua", --- [Exports.QBXExport] = "modules/playerdata.lua", ---}) do --- if GetResourceState(k) == "started" then --- print("^5Loading^7: '"..k.."/"..v.."' ^2into ^7'"..GetCurrentResourceName().."' ...") --- local fileLoader = assert(load(LoadResourceFile(k, (v)), ('@@'..k..'/'..v))) --- fileLoader() --- print("^2Success^7: ^2loaded ^1Core ^2file^7: ^3"..k.."^7/^3"..(v):gsub("/", "^7/^3"):gsub("%.lua", "^7.lua").."^7") --- else --- if debugMode then --- print("^3Warning^7: ^3"..k.." ^2not found^7, ^2skipping") --- end --- end ---end +-- Forcefully loads the files and quietly, compared to fxmanifest complaining if they don't exist +-- This may be better button would require more refinement maybe +--[[ +for k, v in pairs({ -- This is a specific load order + [Exports.OXLibExport] = "init.lua", + [Exports.OXCoreExport] = "lib/init.lua", + [Exports.ESXExport] = "imports.lua", + [Exports.QBXExport] = "modules/playerdata.lua", +}) do + if GetResourceState(k) == "started" then + print("^5Loading^7: '"..k.."/"..v.."' ^2into ^7'"..GetCurrentResourceName().."' ...") + local fileLoader = assert(load(LoadResourceFile(k, (v)), ('@@'..k..'/'..v))) + fileLoader() + print("^2Success^7: ^2loaded ^1Core ^2file^7: ^3"..k.."^7/^3"..(v):gsub("/", "^7/^3"):gsub("%.lua", "^7.lua").."^7") + else + if debugMode then + print("^3Warning^7: ^3"..k.." ^2not found^7, ^2skipping") + end + end +end +]] -- Load files here into the invoking script for _, v in pairs({ -- This is a specific load order @@ -144,4 +152,4 @@ for _, v in pairs({ -- This is a specific load order if debugMode then print("^5Success^7: ^2loaded file^7: ^3"..(v):gsub("/", "^7/^3"):gsub("%.lua", "^7.lua").."^7") end -end +end \ No newline at end of file