Config = {}-- Debug SystemConfig.Debug =false-- Enable or disable debug messages-- Framework settings ( "auto", "QBCore", "ESX" )Config.Framework ="auto"-- Folder name of the core framework resourceConfig.Core ="qb-core"-- Target settings ( "auto", "qb-target", "ox_target" )Config.Target ="auto"-- Notification settings ( "auto", "qb", "okok", "ox_lib", "lation_ui" )Config.Notify ="auto"-- Display settings ( "auto", "ox_lib", "lation_ui" )Config.Display ="auto"-- Enable or disable automatic database table creationConfig.AutoDatabase =true-- Email system ( currently only for lb-phone )Config.EmailSystem =true-- Minimum job grade required to review applicationsConfig.MinimumGrade =0
if (Config.Framework == "auto" and GetResourceState("qb-core") == "started") or Config.Framework == "QBCore" then
QBCore = exports[Config.Core]:GetCoreObject()
elseif (Config.Framework == "auto" and GetResourceState("es_extended") == "started") or Config.Framework == "ESX" then
ESX = exports.es_extended:getSharedObject()
end
function Notify(title, text, type)
if (Config.Notify == "auto" and GetResourceState("qb-core") == "started") or Config.Notify == "qb" then
QBCore.Functions.Notify(text, type, 5000)
elseif (Config.Notify == "auto" and GetResourceState("okokNotify") == "started") or Config.Notify == "okok" then
exports['okokNotify']:Alert(title, text, 5000, type, true)
elseif (Config.Notify == "auto" and GetResourceState("ox_lib") == "started") or Config.Notify == "ox_lib" then
lib.notify({ title = title, description = text, type = type })
elseif (Config.Notify == "auto" and GetResourceState("lation_ui") == "started") or Config.Notify == "lation_ui" then
exports.lation_ui:notify({ title = title, message = text, type = type })
end
end
function RegisterContextMenu(id, title, options)
if (Config.Display == "auto" and GetResourceState("ox_lib") == "started") or Config.Display == "ox_lib" then
lib.registerContext({ id = id, title = title, options = options })
lib.showContext(id)
elseif (Config.Display == "auto" and GetResourceState("lation_ui") == "started") or Config.Display == "lation_ui" then
exports.lation_ui:registerMenu({ id = id, title = title, options = options })
exports.lation_ui:showMenu(id)
end
end
function ShowContextMenu(id)
if (Config.Display == "auto" and GetResourceState("ox_lib") == "started") or Config.Display == "ox_lib" then
lib.showContext(id)
elseif (Config.Display == "auto" and GetResourceState("lation_ui") == "started") or Config.Display == "lation_ui" then
exports.lation_ui:showMenu(id)
end
end
function HideContextMenu()
if (Config.Display == "auto" and GetResourceState("ox_lib") == "started") or Config.Display == "ox_lib" then
lib.hideContext()
elseif (Config.Display == "auto" and GetResourceState("lation_ui") == "started") or Config.Display == "lation_ui" then
exports.lation_ui:hideMenu()
end
end
function GetUserInput(title, fields)
if (Config.Display == "auto" and GetResourceState("ox_lib") == "started") or Config.Display == "ox_lib" then
return lib.inputDialog(title, fields)
elseif (Config.Display == "auto" and GetResourceState("lation_ui") == "started") or Config.Display == "lation_ui" then
return exports.lation_ui:input({
title = title or "",
options = fields
})
end
end