Config Client

local Framework = nil

if Config.Framework == "ESX" then
    Framework = exports['es_extended']:getSharedObject()
elseif Config.Framework == "QBCORE" then
    Framework = exports['qb-core']:GetCoreObject()
elseif Config.Framework == "OTHER" then
-- Put here your code
end


function FrameworkNotification(text, type)
    if Config.Notifications == "OX" then
        lib.notify({ title = "Revel Deliverys", position = "center-left", description = text, type = type })
    elseif Config.Notifications == "ESX" then
        Framework.ShowNotification(text, type)
    elseif Config.Notifications == "QBCORE" then
        Framework.Functions.Notify(text, type)
    elseif config.Notifications == "OTHER" then
        -- Put here your code
    end
end

function FrameworkTextUI(text)
    if Config.TextUI == "OX" then
        lib.showTextUI(text, {position = "left-center", icon = 'card'})
    elseif Config.TextUI == "ESX" then
        Framework.TextUI(text, 'info')
    elseif Config.TextUI == "QBCORE" then 
        exports['qb-core']:DrawText(text, 'left')
    elseif config.TextUI == "OTHER" then
        -- Put here your code
    end
end

function FrameworkHideTextUI()
    if Config.TextUI == "OX" then
        lib.hideTextUI()
    elseif Config.TextUI == "ESX" then
        Framework.HideUI()
    elseif Config.TextUI == "QBCORE" then 
        exports['qb-core']:HideText()
    elseif config.TextUI == "OTHER" then
        -- Put here your code
    end
end

function FrameworkProgressBar(text,duration)
    if Config.ProgressBar == "OX" then
        lib.progressBar({duration = duration, label = text, useWhileDead = false, canCancel = false})
    elseif Config.ProgressBar == "ESX" then
        Framework.Progressbar(text, duration, {FreezePlayer = true})
    elseif Config.ProgressBar == "QBCORE" then 
        Framework.Functions.Progressbar('Revel Deliverys', text, duration, false, false, {disableMovement = true})
    elseif config.ProgressBar == "OTHER" then
        -- Put here your code
    end
end


function DrawText3D(x, y, z, text)
    local onScreen, _x, _y = World3dToScreen2d(x, y, z)
    local px, py, pz = table.unpack(GetGameplayCamCoords())
    SetTextScale(0.32, 0.32)
    SetTextFont(6)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 255)
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(text)
    DrawText(_x, _y)
    local factor = (string.len(text)) / 550
    DrawRect(_x, _y + 0.0125, 0.015 + factor, 0.03, 0, 0, 0, 80)
end

Last updated