Skip to content

Add Dynamic Indicators API for custom HUD elements#39

Open
ihaith4m wants to merge 1 commit intoQbox-project:mainfrom
ihaith4m:feature/dynamic-indicators-api
Open

Add Dynamic Indicators API for custom HUD elements#39
ihaith4m wants to merge 1 commit intoQbox-project:mainfrom
ihaith4m:feature/dynamic-indicators-api

Conversation

@ihaith4m
Copy link

@ihaith4m ihaith4m commented Jan 14, 2026

✨ What's New

This PR adds a Dynamic Indicators API that allows external scripts to add, update, and remove custom indicators on the HUD dynamically. ---

🎯 Features

Export Description
AddCustomIndicator(data) Add a new custom indicator to the HUD

📖 Usage Example

-- Add a custom indicator
exports['qbx_hud']:AddCustomIndicator({
    id = 'example',
    icon = 'fas fa-pills',
    color = '#ff0000',
    value = 75,
    label = 'example Level'
})
-- Update the indicator value
exports['qbx_hud']:UpdateCustomIndicator('example', 50, '#ff9900')
-- Remove the indicator
exports['qbx_hud']:RemoveCustomIndicator('example')

## ✨ What's New
This PR adds a **Dynamic Indicators API** that allows external scripts to add, update, and remove custom indicators on the HUD dynamically.
---
## 🎯 Features
| Export | Description |
|--------|-------------|
| `AddCustomIndicator(data)` | Add a new custom indicator to the HUD |
| `UpdateCustomIndicator(id, value, color)` | Update an existing indicator's value/color |
| `RemoveCustomIndicator(id)` | Remove an indicator from the HUD |
| `GetCustomIndicators()` | Get all current custom indicators |
---
## 📖 Usage Example
```lua
-- Add a custom indicator
exports['qbx_hud']:AddCustomIndicator({
    id = 'example',
    icon = 'fas fa-pills',
    color = '#ff0000',
    value = 75,
    label = 'example Level'
})
-- Update the indicator value
exports['qbx_hud']:UpdateCustomIndicator('example', 50, '#ff9900')
-- Remove the indicator
exports['qbx_hud']:RemoveCustomIndicator('example')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant