Links

qb-hud

Keep track of your vitals in style

Introduction

  • Player heads-up display that tracks vital information such as health, armor, food level, thirst level, etc.
The settings menu uses keymapping and is defaulted to "I"
Player settings are stored using KVP which is located on the player's machine so the only way to reset them is by using the in-game menu buttons

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:GainStress

  • 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))
If you trigger this client side you don't need to define source

hud:server:RelieveStress

  • 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))