📃config_functions

local QBCore = exports[Config.CoreName]:GetCoreObject()

function Notify(msg, type, time)
    if Config.Notify == "qb" then
        QBCore.Functions.Notify(msg, type, time)
    elseif Config.Notify == "ox" then
        lib.notify({ title = 'Notification', description = msg, type = type })
    end
end

function SetFuel(veh)
    if Config.FuelSystem == "LegacyFuel" then
        exports["LegacyFuel"]:SetFuel(veh, 100.0)
    elseif Config.FuelSystem == "okokGasStation" then
        exports['okokGasStation']:SetFuel(veh, 100.0)
    end
end

function GiveKeys(plate, model)
    if Config.KeySystem == "qb" then
        TriggerEvent("vehiclekeys:client:SetOwner", plate)
    elseif Config.KeySystem == "qs" then
        exports['qs-vehiclekeys']:GiveKeys(plate, model)
    end
end

function MakeAnimation(animation)
    if Config.EmoteMenu == "dp" then
        TriggerEvent('animations:client:EmoteCommandStart', {animation})
    elseif Config.EmoteMenu == "rp" then
        exports["rpemotes"]:EmoteCommandStart(animation)
    end
end

function SendHelpText(msg, position)
    if Config.HelpText == "qb" then
        exports['qb-core']:DrawText(msg, position)
    elseif Config.HelpText == "ox" then
        lib.showTextUI(msg)
    end
end

function RemoveHelpText()
    if Config.HelpText == "qb" then
        exports['qb-core']:HideText()
    elseif Config.HelpText == "ox" then
        lib.hideTextUI()
    end
end

Last updated