From 23d39fc6b5ceee10bacf1b62e030ba8d6ec72009 Mon Sep 17 00:00:00 2001 From: Lorraxs Date: Mon, 11 Dec 2023 14:13:07 +0700 Subject: [PATCH] z --- config.lua | 3 ++- fxmanifest.lua | 2 +- main.lua | 19 +++++++++++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/config.lua b/config.lua index 3394ae8..14665e0 100644 --- a/config.lua +++ b/config.lua @@ -5,4 +5,5 @@ Config.EnableModules = { ["Test2"] = true, } Config.Debug = true -Config.Nui = false \ No newline at end of file +Config.Nui = false +Config.Framework = "esx" -- "qb" | "ProjectStarboy" \ No newline at end of file diff --git a/fxmanifest.lua b/fxmanifest.lua index 6406e40..5a3fe39 100644 --- a/fxmanifest.lua +++ b/fxmanifest.lua @@ -27,7 +27,7 @@ ui_page 'web/build/index.html' shared_scripts { '@ox_lib/init.lua', - '@es_extended/imports.lua', + --[[ '@es_extended/imports.lua', ]] "config.lua", "main.lua", "impl.lua", diff --git a/main.lua b/main.lua index adcb197..7c94d1d 100644 --- a/main.lua +++ b/main.lua @@ -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 = {} ResourceName = GetCurrentResourceName() local RegisteredEvents = {} @@ -292,8 +299,16 @@ Citizen.CreateThread(function() Wait(100) end if not IsDuplicityVersion() then - while not ESX.IsPlayerLoaded() do - Wait(100) + if Config.Framework == 'esx' then + 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 while not NuiReady and Config.Nui do Wait(100)