Config Server

local Framework = nil
if Config.Framework == "ESX" then
    Framework = exports['es_extended']:getSharedObject()
elseif Config.Framework == "QBCORE" then
    Framework = exports['qb-core']:GetCoreObject()
end

function FrameworkNotification(text, type, source)
    if Config.Notifications == "OX" then
        TriggerClientEvent('ox_lib:notify', source, {title = 'WaterLeaks', position = "center-left",description = text,type = type})
    elseif Config.Notifications == "ESX" then
        TriggerClientEvent('esx:showNotification', source, text, type)
    elseif Config.Notifications == "QBCORE" then
        source.Functions.Notify(text, type)
    elseif Config.Notifications == "OTHER" then
        -- Put here your code
    end
end


function FrameworkGetPlayer(player)
    if Config.Framework == "ESX" then
        return Framework.GetPlayerFromId(player) 
    elseif Config.Framework == "QBCORE" then
        return Framework.Functions.GetPlayer(player)
    elseif Config.Framework == "OTHER" then
        -- Put here your code
    end
end

function FrameworkPayCheck(player, amount)
    if Config.Framework == "ESX" then
        player.addMoney(amount)
    elseif Config.Framework == "QBCORE" then
        player.Functions.AddMoney('cash', amount)
    elseif Config.Framework == "OTHER" then
        -- Put here your code
    end
end

Last updated