This commit is contained in:
Lorraxs 2023-12-11 14:13:07 +07:00
parent db8983fc4e
commit 23d39fc6b5
3 changed files with 20 additions and 4 deletions

View File

@ -6,3 +6,4 @@ Config.EnableModules = {
} }
Config.Debug = true Config.Debug = true
Config.Nui = false Config.Nui = false
Config.Framework = "esx" -- "qb" | "ProjectStarboy"

View File

@ -27,7 +27,7 @@ ui_page 'web/build/index.html'
shared_scripts { shared_scripts {
'@ox_lib/init.lua', '@ox_lib/init.lua',
'@es_extended/imports.lua', --[[ '@es_extended/imports.lua', ]]
"config.lua", "config.lua",
"main.lua", "main.lua",
"impl.lua", "impl.lua",

View File

@ -1,3 +1,10 @@
Framework = nil
if Config.Framework == 'esx' then
Framework = exports["es_extended"]:getSharedObject()
elseif Config.Framework == "qb" then
Framework = exports['qb-core']:GetCoreObject()
end
Main = {} Main = {}
ResourceName = GetCurrentResourceName() ResourceName = GetCurrentResourceName()
local RegisteredEvents = {} local RegisteredEvents = {}
@ -292,8 +299,16 @@ Citizen.CreateThread(function()
Wait(100) Wait(100)
end end
if not IsDuplicityVersion() then if not IsDuplicityVersion() then
while not ESX.IsPlayerLoaded() do if Config.Framework == 'esx' then
Wait(100) while not ESX.IsPlayerLoaded() do
Wait(100)
end
elseif Config.Framework == 'qb' then
local player = Framework.Functions.GetPlayerData()
while player == nil do
Wait(100)
player = Framework.Functions.GetPlayerData()
end
end end
while not NuiReady and Config.Nui do while not NuiReady and Config.Nui do
Wait(100) Wait(100)