All-Resources/deaktiviert/mAdmin/Source/GetFrameworkObject.lua
2026-04-14 17:41:39 +02:00

86 lines
2.7 KiB
Lua

FrameworkObject = nil
Citizen.CreateThread(function()
FrameworkObject = GetFrameworkObject()
end)
function GetFrameworkObject()
local object = nil
if Config.Framework == "oldesx" then
local counter = 0
while not object do
TriggerEvent('esx:getSharedObject', function(obj) object = obj end)
counter = counter + 1
if counter == 3 then
break
end
Citizen.Wait(1000)
end
if not object then
print(
"codem-adminpanel:Framework is not selected in the config correctly if you're sure it's correct please check your events to get framework object")
end
end
if Config.Framework == "esx" then
local counter = 0
local status = pcall(function()
exports['es_extended']:getSharedObject()
end)
if status then
while not object do
object = exports['es_extended']:getSharedObject()
counter = counter + 1
if counter == 3 then
break
end
Citizen.Wait(1000)
end
end
if not object then
print(
"codem-adminpanel:Framework is not selected in the config correctly if you're sure it's correct please check your events to get framework object")
end
end
if Config.Framework == "qb" then
local counter = 0
local status = pcall(function()
exports["qb-core"]:GetCoreObject()
end)
if status then
while not object do
object = exports["qb-core"]:GetCoreObject()
counter = counter + 1
if counter == 3 then
break
end
Citizen.Wait(1000)
end
end
if not object then
print(
"codem-adminpanel:Framework is not selected in the config correctly if you're sure it's correct please check your events to get framework object")
end
end
if Config.Framework == "oldqb" then
local counter = 0
while not object do
counter = counter + 1
TriggerEvent('QBCore:GetObject', function(obj) object = obj end)
if counter == 3 then
break
end
Citizen.Wait(1000)
end
if not object then
print(
"codem-adminpanel:Framework is not selected in the config correctly if you're sure it's correct please check your events to get framework object")
end
end
return object
end