sc_progress

ESX ESX QBCore QBCore Standalone

A simple progress UI for FiveM that works with all frameworks.

Default

exports.sc_progress:showNUI(time, message)

exports.sc_progress:showNUI(5000, "Loading...")
TriggerClientEvent("sc_progress:showNUI", playerId, time, message)

TriggerClientEvent("sc_progress:showNUI", playerId, 10000, "Loading...")

Example

function startSearching(time, dict, anim, cb)
    local ped = GetPlayerPed(-1)
    canSearch = false

    RequestAnimDict(dict)
    while not HasAnimDictLoaded(dict) do
        Citizen.Wait(0)
    end

    exports.sc_progress:showNUI(time, Translation[Config.Locale]['search'])
    TaskPlayAnim(ped, dict, anim, 8.0, 8.0, time, 1, 1, 0, 0, 0)

    Wait(time)
    ClearPedTasks(ped)
    canSearch = true
    TriggerServerEvent(cb)
end
Preview: sc_progress