mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
refactor(loadFramework): determine target based on resource state
Easier to work with out-the-box.
This commit is contained in:
@@ -10,10 +10,16 @@ local function err(e, n)
|
|||||||
error(('^1%s^0'):format(e), n)
|
error(('^1%s^0'):format(e), n)
|
||||||
end
|
end
|
||||||
|
|
||||||
return function(framework)
|
return function()
|
||||||
if framework == 'ox' then framework = 'ox_core'
|
local framework = GetResourceState('ox_core'):find('start') and 'ox_core'
|
||||||
elseif framework == 'esx' then framework = 'es_extended'
|
|
||||||
elseif framework == 'qbcore' then framework = 'qb-core' end
|
if not framework then
|
||||||
|
framework = GetResourceState('es_extended'):find('start') and 'es_extended'
|
||||||
|
end
|
||||||
|
|
||||||
|
if not framework then
|
||||||
|
framework = GetResourceState('qb-core'):find('start') and 'qb-core'
|
||||||
|
end
|
||||||
|
|
||||||
local result
|
local result
|
||||||
local success, import = pcall(ref, framework)
|
local success, import = pcall(ref, framework)
|
||||||
|
|||||||
Reference in New Issue
Block a user