Skip to content

โ„น qb-hud

Introduction

  • Player heads-up display that tracks vital information such as health, armor, food level, thirst level, etc.

Preview

FAQ

Why do my borders not align with the maps?

Most of the time it generally means your safezone is not set to default in your GTA settings. (Settings/Display/โ€œRestore Defaultsโ€)

How do I enable dev mode?

Simple! All you have to do is type /admin and navigate through the menu to the last section called โ€œDeveloper Optionsโ€ and inside there you should see โ€œDev Modeโ€, this will keep you invincible and add a cool developer icon in your circles/radials

What does the purple circle/radial do?

That is your harness indicator! When you have the item โ€œharnessโ€ in your inventory and while in a vehicle it will appear. Also, when you use your item โ€œharnessโ€, the circle/radial will reflect the amount of uses left and decrease over time.

Useful events

hud:server

  • Source code for reference
RegisterNetEvent('hud:server:GainStress', function(amount)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    local newStress
    if not Player or (Config.DisablePoliceStress and Player.PlayerData.job.name == 'police') then return end
    if not ResetStress then
        if not Player.PlayerData.metadata['stress'] then
            Player.PlayerData.metadata['stress'] = 0
        end
        newStress = Player.PlayerData.metadata['stress'] + amount
        if newStress <= 0 then newStress = 0 end
    else
        newStress = 0
    end
    if newStress > 100 then
        newStress = 100
    end
    Player.Functions.SetMetaData('stress', newStress)
    TriggerClientEvent('hud:client:UpdateStress', src, newStress)
    TriggerClientEvent('QBCore:Notify', src, Lang:t("notify.stress_gain"), 'error', 1500)
end)
  • How to use
TriggerServerEvent('hud:server:GainStress', --[[number]])) 
OR
TriggerServerEvent('hud:server:GainStress', math.random(1, 3))

hud:server

  • Source code for reference
RegisterNetEvent('hud:server:RelieveStress', function(amount)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    local newStress
    if not Player then return end
    if not ResetStress then
        if not Player.PlayerData.metadata['stress'] then
            Player.PlayerData.metadata['stress'] = 0
        end
        newStress = Player.PlayerData.metadata['stress'] - amount
        if newStress <= 0 then newStress = 0 end
    else
        newStress = 0
    end
    if newStress > 100 then
        newStress = 100
    end
    Player.Functions.SetMetaData('stress', newStress)
    TriggerClientEvent('hud:client:UpdateStress', src, newStress)
    TriggerClientEvent('QBCore:Notify', src, Lang:t("notify.stress_removed"))
end)
  • How to use
TriggerServerEvent('hud:server:RelieveStress', --[[number]])) 
OR
TriggerServerEvent('hud:server:RelieveStress', math.random(1, 3))