πŸ”₯All scripts on our website are 50% off!πŸ”₯
Logo

🎯 Triggers

Show HUD

Display the HUD:

TriggerClientEvent("bit-hud:show")

Hide HUD

Hide the HUD:

TriggerClientEvent("bit-hud:hide")

Notifications

Send a notification to a player:

TriggerEvent('bit-hud:noti', PlayerID, "Title", "Message", "info")

Parameters

  • PlayerID: The server ID of the player
  • Title: The notification title (max 18 characters)
  • Message: The notification message (max 152 characters)
  • Type: The alert type (info, warning, success, error)

Examples

Info Notification

TriggerEvent('bit-hud:noti', source, "Information", "This is an info message", "info")

Warning Notification

TriggerEvent('bit-hud:noti', source, "Warning", "This is a warning message", "warning")

Success Notification

TriggerEvent('bit-hud:noti', source, "Success", "Action completed successfully", "success")

Error Notification

TriggerEvent('bit-hud:noti', source, "Error", "Something went wrong", "error")

Usage Examples

Show HUD on Resource Start

AddEventHandler('playerSpawned', function()
    TriggerClientEvent("bit-hud:show", source)
end)

Hide HUD in Safe Zones

-- Client-side example
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1000)
        local playerPed = PlayerPedId()
        local coords = GetEntityCoords(playerPed)
        
        for _, zone in ipairs(safezones) do
            local dist = #(coords - vector3(zone.x, zone.y, zone.z))
            if dist < distance then
                TriggerEvent("bit-hud:hide")
                break
            else
                TriggerEvent("bit-hud:show")
            end
        end
    end
end)

Send Notification on Job Action

-- Server-side example
RegisterServerEvent('yourscript:jobAction')
AddEventHandler('yourscript:jobAction', function()
    local _source = source
    -- Do something
    TriggerEvent('bit-hud:noti', _source, "Job System", "Task completed successfully", "success")
end)