Orbit StudiosOrbit Studios
Orbit Studios Resourcesorbit-dynamichud-v2Interface APIs

ESX integration

Replace ESX notifications, Text UI, and progress actions with Orbit Dynamic HUD 2.0.

ESX integration

These examples target current ESX Legacy client functions. Check your installed ESX version before replacing calls. Start orbit-dynamichud-v2 before resources that call its exports.

Notifications

Replace ESX.ShowNotification(message, type, length, title) in a client script with:

exports['orbit-dynamichud-v2']:notify({
    title = 'Garage',
    description = 'Vehicle stored.',
    type = 'success',
    duration = 3500
})

For an existing call with no title, put its message in description; the HUD supplies a localized heading. Map ESX's info, success, error, and warning types directly. HUD placement is controlled by the HUD, so ESX's notification position is not transferred.

In a server script, replace xPlayer.showNotification(...) or a targeted ESX notification event with the HUD client event:

TriggerClientEvent('orbit-dynamichud:notify', source, {
    description = 'Your vehicle is ready.',
    type = 'info',
    duration = 4000
})

Do not send both the ESX and HUD notification for the same action. ESX.ShowAdvancedNotification, floating help, and per-frame help notifications have GTA-native presentation and are not equivalent to a HUD notification; migrate those only when changing their behavior is acceptable.

Text UI

Replace the call at the point where the interaction becomes available, and hide it when it ends:

-- ESX.TextUI('[E] Open garage', 'info')
exports['orbit-dynamichud-v2']:showTextUI('[E] Open garage', {
    position = 'right-center'
})

-- ESX.HideUI()
exports['orbit-dynamichud-v2']:hideTextUI()

ESX's visual type does not have a direct HUD equivalent. Do not reissue showTextUI every frame. Also hide the prompt when its owning resource stops.

Progress actions

ESX.Progressbar starts an asynchronous action and uses onFinish/onCancel callbacks. The HUD's progressBar waits in the calling Lua thread and returns a completion boolean. To keep callbacks and avoid blocking your event handler, start a thread:

local function startHudProgress(message, duration, options)
    options = options or {}
    if exports['orbit-dynamichud-v2']:progressActive() then return false end

    CreateThread(function()
        local animation = options.animation
        local anim
        if animation and animation.type == 'anim' then
            anim = { dict = animation.dict, clip = animation.lib }
        elseif animation and animation.type == 'Scenario' then
            anim = { scenario = animation.Scenario }
        end

        local completed = exports['orbit-dynamichud-v2']:progressBar({
            label = message,
            duration = duration,
            canCancel = true,
            anim = anim,
            disable = { move = options.FreezePlayer == true }
        })

        if completed then
            if options.onFinish then options.onFinish() end
        elseif options.onCancel then
            options.onCancel()
        end
    end)

    return true
end

startHudProgress('Repairing vehicle', 5000, {
    FreezePlayer = true,
    animation = { type = 'anim', dict = 'mini@repair', lib = 'fixing_a_ped' },
    onFinish = function() TriggerServerEvent('garage:repairFinished') end,
    onCancel = function() print('Repair cancelled') end
})

disable.move blocks movement controls; it is not the same as ESX's FreezeEntityPosition. If you need a hard ped freeze, add that around the HUD call and guarantee it is released on cancellation and resource stop. Replace ESX.CancelProgressbar() with exports['orbit-dynamichud-v2']:cancelProgress() after migrating the corresponding start call.

Scope and cleanup

Replacing calls in your own resource affects that resource only. ESX and other scripts still call their own UI until you migrate those call sites or deliberately maintain an ESX core fork. Do not remove esx_notify, esx_textui, or esx_progressbar just because one script was migrated; search all dependencies first. Keep es_extended and other framework functionality running.

For a timing check, call exports['orbit-dynamichud-v2']:skillCheck('medium', { 'E' }); ESX has no single standard skill-check function to replace. See Skill Check.

On this page