Documentation
Stable HUD
::en::
Stable HUD is a HUD for ESX. Players can drag every part and switch styles in-game, and their layout is saved on their PC.
Requirements
| Resource | Needed for |
|---|---|
es_extended (ESX Legacy 1.14+) | Required. The only dependency. |
pma-voice, saltychat or yaca-voice | Optional. Voice range and radio list. |
esx_status + esx_basicneeds | Optional. Hunger and thirst bars. Or use the SetStatus export. |
Installation
- Download
stable_hudfrom the Cfx.re Portal and put it in yourresourcesfolder. - Add
ensure stable_hudto yourserver.cfg. Put it after ESX, your voice script,esx_statusandesx_basicneeds. - Set it up in
shared/config.hud.luaandserver/config.server.lua. - Restart the server. The console shows
[STABLE] HUD V1 LOADED.
Files you can edit
These files are open. Everything else is escrow-protected.
| File | What it does |
|---|---|
shared/config.hud.lua | Language, server name and colors, notification time, /announce (groups, duration, max length, blacklist), team chat (command, groups, max length, cooldown), voice script, speed unit, settings command and key, radio names, command chat key, which HUD parts are on |
server/config.server.lua | Discord webhook URLs for the announce and team chat logs |
locales/*.lua | All HUD text, one file per language |
data/postals.json | Postal codes (x, y, code). Replace it with your map's postals. |
Configuration
shared/config.hud.lua
Config = Config or {}
-- Official Stable Script config: https://tebex.stable-scripts.store/package/7810767
Config.HUD = {
-- language from locales/ (de, en, es, fr, it, nl, pl, pt, ro, tr), nil = same as es_extended
locale = nil,
branding = {
-- server name / server color
name = 'STABLE',
tag = 'CITY',
color = '#E874FF',
colorDark = '#FFD289', -- if your server has 2 colors use the 2nd one instead of a dark version of the first color
},
-- notification duration in ms
notifyDuration = 5000,
announce = {
command = 'announce',
-- ESX groups allowed to use /announce
groups = {
'owner',
'admin',
},
-- announce duration in ms
duration = 10000,
-- max characters per announce
maxLength = 200,
-- blocked/blacklited words, if someone sends announce with that word it blocks it.
blacklist = {
-- BAD BLOCKED WORDS LIST
'fucking',
'bitch',
'faggot',
},
},
teamchat = {
command = 'tc',
-- ESX groups allowed to write and read the team chat
groups = {
'owner',
'admin',
},
-- max characters per message
maxLength = 200,
-- wait time between two messages per player in ms
cooldown = 500,
},
-- voice script: 'pma-voice', 'saltychat', 'yaca-voice' or false to hide the voice range
voice = 'pma-voice',
-- 'kmh' or 'mph'
speedUnit = 'kmh',
-- settings menu command and default key
settings = {
command = 'hud',
key = 'F10',
},
-- names in the radio list: 'ingame' (ESX character name) or 'fivem'
radioNames = 'ingame',
-- turn parts of the HUD on (true) or off (false)
elements = {
cash = true,
bank = true,
blackMoney = false, -- ESX black_money account under the bank
ammo = true,
location = true, -- postal and street
job = true,
id = true,
players = true,
voice = true,
time = true,
chat = true, -- command chat, key is set below
notifications = true,
lifeinvader = true,
},
-- default key of the command chat, false to disable it
chat = 'T',
}server/config.server.lua
Paste a Discord webhook URL to log every /announce or /tc message. Leave it '' to turn the log off.
Config = Config or {}
Config.Server = {
-- Discord webhook URLs for logs, '' = no log
webhooks = {
-- every /announce with player, ID and message
announce = '', -- https://discord.com/api/webhooks/
-- every /tc team chat message
teamchat = '', -- https://discord.com/api/webhooks/
},
}Turn parts on or off
Every part has a switch in Config.HUD.elements. Everything is on by default except black money.
| Switch | When set to false |
|---|---|
cash, bank | Hidden. The account isn't sent to the HUD. |
blackMoney | Off by default. Set it to true to show ESX black_money under the bank. |
ammo | Hidden. The ammo check doesn't run. |
location | Street, area and postal code are hidden. |
job | Job and grade are hidden. |
id, players, time | Hidden. |
voice | Voice range is hidden. No range marker or notification. |
chat | The command chat key isn't registered. |
notifications | The Notify export and hud:notify event do nothing. Team chat and announcements still show. |
lifeinvader | The LifeInvader export and event do nothing. |
A part that is off is also removed from /hud, so players can't turn it back on.
Languages
The language is picked automatically from your ESX language (the esx:locale convar). If that isn't set, the txAdmin language is used, then English. To force one, set Config.HUD.locale to a code from the table.
| Language | Code | File |
|---|---|---|
en | locales/en.lua | |
de | locales/de.lua | |
es | locales/es.lua | |
fr | locales/fr.lua | |
it | locales/it.lua | |
nl | locales/nl.lua | |
pl | locales/pl.lua | |
pt | locales/pt.lua | |
ro | locales/ro.lua | |
tr | locales/tr.lua |
To add a language, copy locales/en.lua, translate it, and save it as locales/<code>.lua.
What's on screen
Most parts come in several styles: the title 3, the info row 2, money 3, notifications 3, announcements 2, hunger and thirst 3, the speedometer 2. Every player picks their own in /hud, and the default is Style 1.
Server name and info
Your server name and tag from Config.HUD.branding, in your colors. Below: voice range, player count (online / sv_maxclients) and the player's ID.
Money and ammo
Cash (money), bank (bank) and black money (black_money), live from ESX. Black money is off by default, turn it on with Config.HUD.elements.blackMoney. Ammo with the ESX weapon name shows while a weapon is out.
Notifications and LifeInvader
Info, success and error notifications, team chat (blue) and LifeInvader ads with the sender's name and phone number.
Announcements
From /announce, the Announce export, and txAdmin. They show the sender's name.
Hunger and thirst
From esx_status, or from your own needs script through the SetStatus export.
Speedometer
Speed, gear and fuel. Pick km/h or mph with Config.HUD.speedUnit.
Help prompts
{E}and[E]are drawn as a key. Square brackets work for keys up to 5 characters, like[E]or[SPACE].- GTA codes like
~INPUT_CONTEXT~become the player's real key. - Color codes like
~g~are removed.
So existing ESX scripts work without changes.
Radio list, location and job
The radio list shows the frequency and everyone on it. The person talking turns green. Config.HUD.radioNames picks 'ingame' (ESX character name) or 'fivem'. It uses your voice script's radio, no setup needed.
Street, area and postal code sit next to the minimap, with the job and grade. The job updates live on esx:setJob.
Settings menu
Players open it with /hud or F10. They can drag every part, change the size and pick a style for each part. Reset puts everything back.
Commands
| Command | Who | What it does |
|---|---|---|
/hud (key F10)Config.HUD.settings | Everyone | Opens the settings menu. Players can rebind the key in GTA Settings → Key Bindings → FiveM. |
TConfig.HUD.chat | Everyone | Opens the command chat. See below. |
/announce <text>Config.HUD.announce.command | Groups in Config.HUD.announce.groups, server console | Announcement to all players with the sender's FiveM name. |
/tc <text>Config.HUD.teamchat.command | Groups in Config.HUD.teamchat.groups | Team chat. A blue notification with the sender's FiveM name. Only these groups can send and read it. |
Limits and blacklist
- Max length:
/announceand/tcallow 200 characters each (maxLength). Longer messages are refused with a notification. - Team chat cooldown: a player has to wait 500 ms between two
/tcmessages (Config.HUD.teamchat.cooldown). - Blacklist: an announcement that contains a word from
Config.HUD.announce.blacklistis blocked. Case doesn't matter, only whole words match, and an entry can be several words. txAdmin announcements are checked too. Announcements from the server console are not.
Command chat
The HUD has its own command input, so you don't need the default chat resource.
- Type a command with
/, for example/announce Hello. Enteror the send button runs it.- Arrow keys go through recent commands.
Esccloses it.
It only runs commands, it doesn't send chat messages. Remove ensure chat from your server.cfg, or set Config.HUD.chat = false (or Config.HUD.elements.chat = false) to keep the default chat.
Discord logs
Set the webhooks in server/config.server.lua. Every log is an embed in your server color with:
- The message.
- The player's FiveM name, ID and ESX group.
- Their in-game (character) name.
- Their identifiers, without the IP address.
announce logs /announce and txAdmin announcements (shown as txAdmin (name)). teamchat logs every /tc message.
Client exports
-- notification; type 'info' | 'success' | 'error', duration in ms (optional)
exports.stable_hud:Notify('Title', 'Message', 'success', 5000)
-- LifeInvader ad, shown only to this player; sender and duration in ms are optional
exports.stable_hud:LifeInvader('Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- help prompt: call it every frame while it should show, it hides by itself 250 ms after the last call
-- or pass a duration in ms to show it once
exports.stable_hud:HelpNotify('Press {E} to open the garage')
exports.stable_hud:HelpNotify('Press {E} to open the garage', 3000)
exports.stable_hud:HideHelpNotify()
-- hide or show the whole HUD (cutscenes, cameras, photo mode ...)
exports.stable_hud:SetVisible(false)
exports.stable_hud:SetVisible(true)
local visible = exports.stable_hud:IsVisible()
-- hunger and thirst from your own needs script, values 0-100
exports.stable_hud:SetStatus({ hunger = 80, thirst = 55 })The HUD hides itself while the pause menu is open.
Server exports
-- notification for one player
exports.stable_hud:Notify(source, 'Title', 'Message', 'info', 5000)
-- announcement for everyone; title, duration (ms) and author are optional
exports.stable_hud:Announce('Server restart in 10 minutes')
exports.stable_hud:Announce('Server restart in 10 minutes', 'Restart', 15000, 'Admin')
-- LifeInvader ad; target is a player id or -1 for everyone
-- sender as a player id: the RP name is filled in from ESX
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', source)
-- add the phone number from your phone script (optional)
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { source = source, phone = '555-0142' })
-- or set everything yourself
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- hide or show the HUD of one player
exports.stable_hud:SetVisible(source, false)Use the HUD for all ESX notifications
In es_extended/client/functions.lua, replace these two functions. Every script that uses ESX notifications or help texts then shows them in the HUD. That includes xPlayer.showNotification on the server.
function ESX.ShowNotification(message, notifyType, length, title, position)
return exports.stable_hud:Notify(title or 'Info', message, notifyType or 'info', length)
end
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
return exports.stable_hud:HelpNotify(msg, duration)
endIntegrations
- txAdmin: announcements (with the admin's name) and scheduled restart warnings show as HUD announcements. To hide txAdmin's own popups, add this to
server.cfg:setr txAdmin-hideDefaultAnnouncement true setr txAdmin-hideDefaultScheduledRestartWarning true - esx_status: hunger and thirst update every second.
- Voice (
pma-voice,saltychat,yaca-voice): pick it withConfig.HUD.voice, or set it tofalseto hide the voice range. When the range changes, a marker shows around the player with a notification. - GTA's own HUD (cash, ammo, area, street, vehicle name) is moved off-screen once at start, with no loop. It comes back when the resource stops.
Troubleshooting
| Problem | Fix |
|---|---|
Console: [STABLE] esx_status not started or esx_basicneeds not started | Start both before stable_hud, or use the SetStatus export. |
| Hunger and thirst never show, but both are running | Check the F8 console for ESX errors. If ESX never finishes loading the player, esx_status never sends values. |
/announce or /tc does nothing | Your ESX group isn't in Config.HUD.announce.groups or Config.HUD.teamchat.groups. |
| "Your announcement contains a blocked word." | The message has a word from Config.HUD.announce.blacklist. |
| "Your message is too long" | Over maxLength (200 characters by default). |
| No Discord logs | Check the webhook URLs in server/config.server.lua. |
| A player's layout is broken | Open /hud and press Reset. |
::de::
Stable HUD ist ein HUD für ESX. Spieler können jedes Element verschieben und Styles im Spiel wechseln. Ihr Layout wird auf ihrem PC gespeichert.
Voraussetzungen
| Resource | Wofür |
|---|---|
es_extended (ESX Legacy 1.14+) | Erforderlich. Die einzige Abhängigkeit. |
pma-voice, saltychat oder yaca-voice | Optional. Sprachreichweite und Funkliste. |
esx_status + esx_basicneeds | Optional. Hunger- und Durstanzeige. Oder nutze den SetStatus-Export. |
Installation
- Lade
stable_hudim Cfx.re Portal herunter und lege es in deinenresources-Ordner. - Füge
ensure stable_hudzu deinerserver.cfghinzu. Setze es nach ESX, deinem Voice-Script,esx_statusundesx_basicneeds. - Richte es in
shared/config.hud.luaundserver/config.server.luaein. - Starte den Server neu. In der Konsole steht
[STABLE] HUD V1 LOADED.
Dateien, die du bearbeiten kannst
Diese Dateien sind offen. Alles andere ist durch Escrow geschützt.
| Datei | Was sie macht |
|---|---|
shared/config.hud.lua | Sprache, Servername und Farben, Anzeigedauer der Benachrichtigungen, /announce (Gruppen, Dauer, max. Länge, Blacklist), Teamchat (Befehl, Gruppen, max. Länge, Cooldown), Voice-Script, Geschwindigkeitseinheit, Befehl und Taste für die Einstellungen, Funknamen, Taste für den Befehls-Chat, welche HUD-Elemente an sind |
server/config.server.lua | Discord-Webhook-URLs für die Announce- und Teamchat-Logs |
locales/*.lua | Alle HUD-Texte, eine Datei pro Sprache |
data/postals.json | Postleitzahlen (x, y, code). Ersetze sie durch die Postals deiner Map. |
Konfiguration
shared/config.hud.lua
Config = Config or {}
-- Official Stable Script config: https://tebex.stable-scripts.store/package/7810767
Config.HUD = {
-- language from locales/ (de, en, es, fr, it, nl, pl, pt, ro, tr), nil = same as es_extended
locale = nil,
branding = {
-- server name / server color
name = 'STABLE',
tag = 'CITY',
color = '#E874FF',
colorDark = '#FFD289', -- if your server has 2 colors use the 2nd one instead of a dark version of the first color
},
-- notification duration in ms
notifyDuration = 5000,
announce = {
command = 'announce',
-- ESX groups allowed to use /announce
groups = {
'owner',
'admin',
},
-- announce duration in ms
duration = 10000,
-- max characters per announce
maxLength = 200,
-- blocked/blacklited words, if someone sends announce with that word it blocks it.
blacklist = {
-- BAD BLOCKED WORDS LIST
'fucking',
'bitch',
'faggot',
},
},
teamchat = {
command = 'tc',
-- ESX groups allowed to write and read the team chat
groups = {
'owner',
'admin',
},
-- max characters per message
maxLength = 200,
-- wait time between two messages per player in ms
cooldown = 500,
},
-- voice script: 'pma-voice', 'saltychat', 'yaca-voice' or false to hide the voice range
voice = 'pma-voice',
-- 'kmh' or 'mph'
speedUnit = 'kmh',
-- settings menu command and default key
settings = {
command = 'hud',
key = 'F10',
},
-- names in the radio list: 'ingame' (ESX character name) or 'fivem'
radioNames = 'ingame',
-- turn parts of the HUD on (true) or off (false)
elements = {
cash = true,
bank = true,
blackMoney = false, -- ESX black_money account under the bank
ammo = true,
location = true, -- postal and street
job = true,
id = true,
players = true,
voice = true,
time = true,
chat = true, -- command chat, key is set below
notifications = true,
lifeinvader = true,
},
-- default key of the command chat, false to disable it
chat = 'T',
}server/config.server.lua
Füge eine Discord-Webhook-URL ein, um jede /announce- oder /tc-Nachricht zu loggen. Lass sie auf '', um das Log abzuschalten.
Config = Config or {}
Config.Server = {
-- Discord webhook URLs for logs, '' = no log
webhooks = {
-- every /announce with player, ID and message
announce = '', -- https://discord.com/api/webhooks/
-- every /tc team chat message
teamchat = '', -- https://discord.com/api/webhooks/
},
}Elemente ein- und ausschalten
Jedes Element hat einen Schalter in Config.HUD.elements. Standardmäßig ist alles an, außer Schwarzgeld.
| Schalter | Wenn auf false |
|---|---|
cash, bank | Ausgeblendet. Das Konto wird nicht ans HUD gesendet. |
blackMoney | Standardmäßig aus. Auf true setzen, um ESX black_money unter der Bank zu zeigen. |
ammo | Ausgeblendet. Die Munitionsprüfung läuft nicht. |
location | Straße, Gebiet und Postleitzahl sind ausgeblendet. |
job | Job und Rang sind ausgeblendet. |
id, players, time | Ausgeblendet. |
voice | Sprachreichweite ausgeblendet. Kein Reichweiten-Marker und keine Benachrichtigung. |
chat | Die Taste für den Befehls-Chat wird nicht registriert. |
notifications | Der Notify-Export und das Event hud:notify tun nichts. Teamchat und Ankündigungen erscheinen weiterhin. |
lifeinvader | Der LifeInvader-Export und das Event tun nichts. |
Ein ausgeschaltetes Element verschwindet auch aus /hud, Spieler können es also nicht wieder einschalten.
Sprachen
Die Sprache wird automatisch aus deiner ESX-Sprache gewählt (Convar esx:locale). Ist sie nicht gesetzt, wird die txAdmin-Sprache genutzt, danach Englisch. Um eine Sprache zu erzwingen, setze Config.HUD.locale auf einen Code aus der Tabelle.
| Sprache | Code | Datei |
|---|---|---|
en | locales/en.lua | |
de | locales/de.lua | |
es | locales/es.lua | |
fr | locales/fr.lua | |
it | locales/it.lua | |
nl | locales/nl.lua | |
pl | locales/pl.lua | |
pt | locales/pt.lua | |
ro | locales/ro.lua | |
tr | locales/tr.lua |
Für eine neue Sprache kopiere locales/en.lua, übersetze sie und speichere sie als locales/<code>.lua.
Was auf dem Bildschirm ist
Die meisten Elemente gibt es in mehreren Styles: Titel 3, Infozeile 2, Geld 3, Benachrichtigungen 3, Ankündigungen 2, Hunger und Durst 3, Tacho 2. Jeder Spieler wählt seine eigenen in /hud. Standard ist Style 1.
Servername und Infos
Dein Servername und Tag aus Config.HUD.branding, in deinen Farben. Darunter: Sprachreichweite, Spielerzahl (online / sv_maxclients) und die ID des Spielers.
Geld und Munition
Bargeld (money), Bank (bank) und Schwarzgeld (black_money), live aus ESX. Schwarzgeld ist standardmäßig aus, einschalten mit Config.HUD.elements.blackMoney. Munition mit dem ESX-Waffennamen erscheint, solange eine Waffe gezogen ist.
Benachrichtigungen und LifeInvader
Info-, Erfolgs- und Fehlerbenachrichtigungen, Teamchat (blau) und LifeInvader-Anzeigen mit Name und Telefonnummer des Absenders.
Ankündigungen
Von /announce, dem Announce-Export und txAdmin. Sie zeigen den Namen des Absenders.
Hunger und Durst
Von esx_status oder von deinem eigenen Needs-Script über den SetStatus-Export.
Tacho
Geschwindigkeit, Gang und Tank. Wähle km/h oder mph mit Config.HUD.speedUnit.
Hilfetexte
{E}und[E]werden als Taste angezeigt. Eckige Klammern funktionieren für Tasten bis 5 Zeichen, z. B.[E]oder[SPACE].- GTA-Codes wie
~INPUT_CONTEXT~werden zur echten Taste des Spielers. - Farbcodes wie
~g~werden entfernt.
Bestehende ESX-Scripts funktionieren also ohne Änderungen.
Funkliste, Standort und Job
Die Funkliste zeigt die Frequenz und alle darauf. Wer spricht, wird grün. Config.HUD.radioNames wählt 'ingame' (ESX-Charaktername) oder 'fivem'. Sie nutzt den Funk deines Voice-Scripts, ohne Einrichtung.
Straße, Gebiet und Postleitzahl stehen neben der Minimap, mit Job und Rang. Der Job aktualisiert sich live bei esx:setJob.
Einstellungsmenü
Spieler öffnen es mit /hud oder F10. Sie können jedes Element verschieben, die Größe ändern und für jedes Element einen Style wählen. Zurücksetzen stellt alles wieder her.
Befehle
| Befehl | Wer | Was er macht |
|---|---|---|
/hud (Taste F10)Config.HUD.settings | Alle | Öffnet das Einstellungsmenü. Spieler können die Taste unter GTA-Einstellungen → Tastenbelegung → FiveM ändern. |
TConfig.HUD.chat | Alle | Öffnet den Befehls-Chat. Siehe unten. |
/announce <text>Config.HUD.announce.command | Gruppen in Config.HUD.announce.groups, Serverkonsole | Ankündigung an alle Spieler mit dem FiveM-Namen des Absenders. |
/tc <text>Config.HUD.teamchat.command | Gruppen in Config.HUD.teamchat.groups | Teamchat. Eine blaue Benachrichtigung mit dem FiveM-Namen des Absenders. Nur diese Gruppen können ihn senden und lesen. |
Limits und Blacklist
- Max. Länge:
/announceund/tcerlauben je 200 Zeichen (maxLength). Längere Nachrichten werden mit einer Benachrichtigung abgelehnt. - Teamchat-Cooldown: Ein Spieler muss 500 ms zwischen zwei
/tc-Nachrichten warten (Config.HUD.teamchat.cooldown). - Blacklist: Eine Ankündigung mit einem Wort aus
Config.HUD.announce.blacklistwird blockiert. Groß- und Kleinschreibung egal, nur ganze Wörter zählen, und ein Eintrag kann aus mehreren Wörtern bestehen. txAdmin-Ankündigungen werden auch geprüft, Ankündigungen aus der Serverkonsole nicht.
Befehls-Chat
Das HUD hat eine eigene Befehlseingabe, du brauchst also die Standard-Resource chat nicht.
- Tippe einen Befehl mit
/, zum Beispiel/announce Hallo. Enteroder der Senden-Button führt ihn aus.- Mit den Pfeiltasten gehst du durch die letzten Befehle.
Escschließt ihn.
Er führt nur Befehle aus und sendet keine Chatnachrichten. Entferne ensure chat aus deiner server.cfg oder setze Config.HUD.chat = false (oder Config.HUD.elements.chat = false), um den Standard-Chat zu behalten.
Discord-Logs
Trage die Webhooks in server/config.server.lua ein. Jedes Log ist ein Embed in deiner Serverfarbe mit:
- Der Nachricht.
- FiveM-Name, ID und ESX-Gruppe des Spielers.
- Seinem Ingame-Namen (Charakter).
- Seinen Identifiern, ohne IP-Adresse.
announce loggt /announce und txAdmin-Ankündigungen (angezeigt als txAdmin (name)). teamchat loggt jede /tc-Nachricht.
Client-Exports
-- notification; type 'info' | 'success' | 'error', duration in ms (optional)
exports.stable_hud:Notify('Title', 'Message', 'success', 5000)
-- LifeInvader ad, shown only to this player; sender and duration in ms are optional
exports.stable_hud:LifeInvader('Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- help prompt: call it every frame while it should show, it hides by itself 250 ms after the last call
-- or pass a duration in ms to show it once
exports.stable_hud:HelpNotify('Press {E} to open the garage')
exports.stable_hud:HelpNotify('Press {E} to open the garage', 3000)
exports.stable_hud:HideHelpNotify()
-- hide or show the whole HUD (cutscenes, cameras, photo mode ...)
exports.stable_hud:SetVisible(false)
exports.stable_hud:SetVisible(true)
local visible = exports.stable_hud:IsVisible()
-- hunger and thirst from your own needs script, values 0-100
exports.stable_hud:SetStatus({ hunger = 80, thirst = 55 })Das HUD blendet sich aus, solange das Pausenmenü offen ist.
Server-Exports
-- notification for one player
exports.stable_hud:Notify(source, 'Title', 'Message', 'info', 5000)
-- announcement for everyone; title, duration (ms) and author are optional
exports.stable_hud:Announce('Server restart in 10 minutes')
exports.stable_hud:Announce('Server restart in 10 minutes', 'Restart', 15000, 'Admin')
-- LifeInvader ad; target is a player id or -1 for everyone
-- sender as a player id: the RP name is filled in from ESX
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', source)
-- add the phone number from your phone script (optional)
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { source = source, phone = '555-0142' })
-- or set everything yourself
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- hide or show the HUD of one player
exports.stable_hud:SetVisible(source, false)Das HUD für alle ESX-Benachrichtigungen nutzen
Ersetze in es_extended/client/functions.lua diese zwei Funktionen. Dann zeigt jedes Script, das ESX-Benachrichtigungen oder Hilfetexte nutzt, sie im HUD an. Das gilt auch für xPlayer.showNotification auf dem Server.
function ESX.ShowNotification(message, notifyType, length, title, position)
return exports.stable_hud:Notify(title or 'Info', message, notifyType or 'info', length)
end
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
return exports.stable_hud:HelpNotify(msg, duration)
endIntegrationen
- txAdmin: Ankündigungen (mit dem Namen des Admins) und geplante Neustart-Warnungen erscheinen als HUD-Ankündigungen. Um die eigenen Popups von txAdmin auszublenden, füge das zu deiner
server.cfghinzu:setr txAdmin-hideDefaultAnnouncement true setr txAdmin-hideDefaultScheduledRestartWarning true - esx_status: Hunger und Durst aktualisieren sich jede Sekunde.
- Voice (
pma-voice,saltychat,yaca-voice): wähle es mitConfig.HUD.voiceoder setze es auffalse, um die Sprachreichweite auszublenden. Ändert sich die Reichweite, erscheint ein Marker um den Spieler und eine Benachrichtigung. - Das GTA-eigene HUD (Geld, Munition, Gebiet, Straße, Fahrzeugname) wird einmal beim Start aus dem Bild geschoben, ohne Schleife. Es kommt zurück, wenn die Resource stoppt.
Fehlerbehebung
| Problem | Lösung |
|---|---|
Konsole: [STABLE] esx_status not started oder esx_basicneeds not started | Starte beide vor stable_hud oder nutze den SetStatus-Export. |
| Hunger und Durst erscheinen nie, obwohl beide laufen | Prüfe die F8-Konsole auf ESX-Fehler. Wenn ESX den Spieler nie fertig lädt, sendet esx_status keine Werte. |
/announce oder /tc tut nichts | Deine ESX-Gruppe ist nicht in Config.HUD.announce.groups oder Config.HUD.teamchat.groups. |
| „Deine Ankündigung enthält ein gesperrtes Wort." | Die Nachricht enthält ein Wort aus Config.HUD.announce.blacklist. |
| „Deine Nachricht ist zu lang" | Über maxLength (standardmäßig 200 Zeichen). |
| Keine Discord-Logs | Prüfe die Webhook-URLs in server/config.server.lua. |
| Das Layout eines Spielers ist kaputt | /hud öffnen und auf Zurücksetzen drücken. |
::ru::
Stable HUD — это HUD для ESX. Игроки могут перетаскивать любой элемент и менять стили прямо в игре, а их раскладка сохраняется на их ПК.
Требования
| Ресурс | Для чего |
|---|---|
es_extended (ESX Legacy 1.14+) | Обязательно. Единственная зависимость. |
pma-voice, saltychat или yaca-voice | Необязательно. Дальность голоса и список рации. |
esx_status + esx_basicneeds | Необязательно. Полоски голода и жажды. Или используйте экспорт SetStatus. |
Установка
- Скачайте
stable_hudв Cfx.re Portal и положите его в папкуresources. - Добавьте
ensure stable_hudвserver.cfg. Поставьте его после ESX, вашего голосового скрипта,esx_statusиesx_basicneeds. - Настройте его в
shared/config.hud.luaиserver/config.server.lua. - Перезапустите сервер. В консоли появится
[STABLE] HUD V1 LOADED.
Файлы, которые можно менять
Эти файлы открыты. Всё остальное защищено escrow.
| Файл | Что делает |
|---|---|
shared/config.hud.lua | Язык, название и цвета сервера, время уведомлений, /announce (группы, длительность, макс. длина, чёрный список), командный чат (команда, группы, макс. длина, задержка), голосовой скрипт, единица скорости, команда и клавиша настроек, имена в рации, клавиша чата команд, какие элементы HUD включены |
server/config.server.lua | URL Discord-вебхуков для логов объявлений и командного чата |
locales/*.lua | Все тексты HUD, по файлу на язык |
data/postals.json | Почтовые индексы (x, y, code). Замените на индексы вашей карты. |
Настройка
shared/config.hud.lua
Config = Config or {}
-- Official Stable Script config: https://tebex.stable-scripts.store/package/7810767
Config.HUD = {
-- language from locales/ (de, en, es, fr, it, nl, pl, pt, ro, tr), nil = same as es_extended
locale = nil,
branding = {
-- server name / server color
name = 'STABLE',
tag = 'CITY',
color = '#E874FF',
colorDark = '#FFD289', -- if your server has 2 colors use the 2nd one instead of a dark version of the first color
},
-- notification duration in ms
notifyDuration = 5000,
announce = {
command = 'announce',
-- ESX groups allowed to use /announce
groups = {
'owner',
'admin',
},
-- announce duration in ms
duration = 10000,
-- max characters per announce
maxLength = 200,
-- blocked/blacklited words, if someone sends announce with that word it blocks it.
blacklist = {
-- BAD BLOCKED WORDS LIST
'fucking',
'bitch',
'faggot',
},
},
teamchat = {
command = 'tc',
-- ESX groups allowed to write and read the team chat
groups = {
'owner',
'admin',
},
-- max characters per message
maxLength = 200,
-- wait time between two messages per player in ms
cooldown = 500,
},
-- voice script: 'pma-voice', 'saltychat', 'yaca-voice' or false to hide the voice range
voice = 'pma-voice',
-- 'kmh' or 'mph'
speedUnit = 'kmh',
-- settings menu command and default key
settings = {
command = 'hud',
key = 'F10',
},
-- names in the radio list: 'ingame' (ESX character name) or 'fivem'
radioNames = 'ingame',
-- turn parts of the HUD on (true) or off (false)
elements = {
cash = true,
bank = true,
blackMoney = false, -- ESX black_money account under the bank
ammo = true,
location = true, -- postal and street
job = true,
id = true,
players = true,
voice = true,
time = true,
chat = true, -- command chat, key is set below
notifications = true,
lifeinvader = true,
},
-- default key of the command chat, false to disable it
chat = 'T',
}server/config.server.lua
Вставьте URL Discord-вебхука, чтобы логировать каждое сообщение /announce или /tc. Оставьте '', чтобы выключить лог.
Config = Config or {}
Config.Server = {
-- Discord webhook URLs for logs, '' = no log
webhooks = {
-- every /announce with player, ID and message
announce = '', -- https://discord.com/api/webhooks/
-- every /tc team chat message
teamchat = '', -- https://discord.com/api/webhooks/
},
}Включение и выключение элементов
У каждого элемента есть переключатель в Config.HUD.elements. По умолчанию включено всё, кроме грязных денег.
| Переключатель | Если false |
|---|---|
cash, bank | Скрыто. Счёт не передаётся в HUD. |
blackMoney | По умолчанию выключено. Поставьте true, чтобы показывать ESX black_money под банком. |
ammo | Скрыто. Проверка патронов не запускается. |
location | Улица, район и почтовый индекс скрыты. |
job | Работа и ранг скрыты. |
id, players, time | Скрыто. |
voice | Дальность голоса скрыта. Нет маркера и уведомления о смене дальности. |
chat | Клавиша чата команд не регистрируется. |
notifications | Экспорт Notify и событие hud:notify ничего не делают. Командный чат и объявления продолжают показываться. |
lifeinvader | Экспорт LifeInvader и событие ничего не делают. |
Выключенный элемент также пропадает из /hud, поэтому игроки не могут включить его обратно.
Языки
Язык выбирается автоматически по языку ESX (convar esx:locale). Если он не задан, берётся язык txAdmin, затем английский. Чтобы задать язык вручную, укажите в Config.HUD.locale код из таблицы.
| Язык | Код | Файл |
|---|---|---|
en | locales/en.lua | |
de | locales/de.lua | |
es | locales/es.lua | |
fr | locales/fr.lua | |
it | locales/it.lua | |
nl | locales/nl.lua | |
pl | locales/pl.lua | |
pt | locales/pt.lua | |
ro | locales/ro.lua | |
tr | locales/tr.lua |
Чтобы добавить язык, скопируйте locales/en.lua, переведите его и сохраните как locales/<код>.lua.
Что на экране
У большинства элементов несколько стилей: заголовок 3, строка информации 2, деньги 3, уведомления 3, объявления 2, голод и жажда 3, спидометр 2. Каждый игрок выбирает свои в /hud, по умолчанию стоит стиль 1.
Название сервера и информация
Название и тег сервера из Config.HUD.branding в ваших цветах. Ниже: дальность голоса, число игроков (онлайн / sv_maxclients) и ID игрока.
Деньги и патроны
Наличные (money), банк (bank) и грязные деньги (black_money) в реальном времени из ESX. Грязные деньги по умолчанию выключены, включаются через Config.HUD.elements.blackMoney. Патроны с названием оружия из ESX видны, пока оружие в руках.
Уведомления и LifeInvader
Информационные уведомления, уведомления об успехе и ошибке, командный чат (синий) и объявления LifeInvader с именем и номером телефона отправителя.
Объявления
Из /announce, экспорта Announce и txAdmin. Показывают имя отправителя.
Голод и жажда
Из esx_status или из вашего скрипта потребностей через экспорт SetStatus.
Спидометр
Скорость, передача и топливо. Выберите км/ч или mph в Config.HUD.speedUnit.
Подсказки
{E}и[E]отображаются как клавиша. Квадратные скобки работают для клавиш до 5 символов, например[E]или[SPACE].- Коды GTA вроде
~INPUT_CONTEXT~превращаются в настоящую клавишу игрока. - Цветовые коды вроде
~g~убираются.
Поэтому существующие ESX-скрипты работают без изменений.
Список рации, местоположение и работа
Список рации показывает частоту и всех, кто на ней. Говорящий подсвечивается зелёным. Config.HUD.radioNames выбирает 'ingame' (имя персонажа ESX) или 'fivem'. Используется рация вашего голосового скрипта, настройка не нужна.
Улица, район и почтовый индекс находятся рядом с миникартой, вместе с работой и рангом. Работа обновляется сразу при esx:setJob.
Меню настроек
Игроки открывают его через /hud или F10. Можно перетаскивать любой элемент, менять размер и выбирать стиль для каждого элемента. Кнопка сброса возвращает всё как было.
Команды
| Команда | Кто | Что делает |
|---|---|---|
/hud (клавиша F10)Config.HUD.settings | Все | Открывает меню настроек. Клавишу можно переназначить в настройках GTA → Назначение клавиш → FiveM. |
TConfig.HUD.chat | Все | Открывает чат команд. См. ниже. |
/announce <текст>Config.HUD.announce.command | Группы из Config.HUD.announce.groups, консоль сервера | Объявление всем игрокам с FiveM-именем отправителя. |
/tc <текст>Config.HUD.teamchat.command | Группы из Config.HUD.teamchat.groups | Командный чат. Синее уведомление с FiveM-именем отправителя. Отправлять и читать его могут только эти группы. |
Ограничения и чёрный список
- Макс. длина:
/announceи/tcдопускают по 200 символов (maxLength). Более длинные сообщения отклоняются с уведомлением. - Задержка командного чата: между двумя сообщениями
/tcигрок ждёт 500 мс (Config.HUD.teamchat.cooldown). - Чёрный список: объявление со словом из
Config.HUD.announce.blacklistблокируется. Регистр не важен, совпадают только целые слова, а запись может состоять из нескольких слов. Объявления txAdmin тоже проверяются, объявления из консоли сервера — нет.
Чат команд
У HUD есть своё поле ввода команд, поэтому стандартный ресурс chat не нужен.
- Введите команду с
/, например/announce Привет. Enterили кнопка отправки выполняет её.- Стрелки листают последние команды.
Escзакрывает чат.
Он только выполняет команды и не отправляет сообщения в чат. Уберите ensure chat из server.cfg или поставьте Config.HUD.chat = false (или Config.HUD.elements.chat = false), чтобы оставить стандартный чат.
Логи в Discord
Укажите вебхуки в server/config.server.lua. Каждый лог — это embed в цвете вашего сервера, в котором есть:
- Сообщение.
- FiveM-имя игрока, ID и группа ESX.
- Его игровое имя (персонажа).
- Его идентификаторы, без IP-адреса.
announce логирует /announce и объявления txAdmin (как txAdmin (name)). teamchat логирует каждое сообщение /tc.
Клиентские экспорты
-- notification; type 'info' | 'success' | 'error', duration in ms (optional)
exports.stable_hud:Notify('Title', 'Message', 'success', 5000)
-- LifeInvader ad, shown only to this player; sender and duration in ms are optional
exports.stable_hud:LifeInvader('Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- help prompt: call it every frame while it should show, it hides by itself 250 ms after the last call
-- or pass a duration in ms to show it once
exports.stable_hud:HelpNotify('Press {E} to open the garage')
exports.stable_hud:HelpNotify('Press {E} to open the garage', 3000)
exports.stable_hud:HideHelpNotify()
-- hide or show the whole HUD (cutscenes, cameras, photo mode ...)
exports.stable_hud:SetVisible(false)
exports.stable_hud:SetVisible(true)
local visible = exports.stable_hud:IsVisible()
-- hunger and thirst from your own needs script, values 0-100
exports.stable_hud:SetStatus({ hunger = 80, thirst = 55 })HUD скрывается, пока открыто меню паузы.
Серверные экспорты
-- notification for one player
exports.stable_hud:Notify(source, 'Title', 'Message', 'info', 5000)
-- announcement for everyone; title, duration (ms) and author are optional
exports.stable_hud:Announce('Server restart in 10 minutes')
exports.stable_hud:Announce('Server restart in 10 minutes', 'Restart', 15000, 'Admin')
-- LifeInvader ad; target is a player id or -1 for everyone
-- sender as a player id: the RP name is filled in from ESX
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', source)
-- add the phone number from your phone script (optional)
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { source = source, phone = '555-0142' })
-- or set everything yourself
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- hide or show the HUD of one player
exports.stable_hud:SetVisible(source, false)HUD для всех уведомлений ESX
В es_extended/client/functions.lua замените эти две функции. Тогда любой скрипт, использующий уведомления или подсказки ESX, покажет их в HUD. Это касается и xPlayer.showNotification на сервере.
function ESX.ShowNotification(message, notifyType, length, title, position)
return exports.stable_hud:Notify(title or 'Info', message, notifyType or 'info', length)
end
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
return exports.stable_hud:HelpNotify(msg, duration)
endИнтеграции
- txAdmin: объявления (с именем админа) и предупреждения о плановом рестарте показываются как объявления HUD. Чтобы скрыть собственные окна txAdmin, добавьте это в
server.cfg:setr txAdmin-hideDefaultAnnouncement true setr txAdmin-hideDefaultScheduledRestartWarning true - esx_status: голод и жажда обновляются каждую секунду.
- Голос (
pma-voice,saltychat,yaca-voice): выберите его вConfig.HUD.voiceили поставьтеfalse, чтобы скрыть дальность голоса. При смене дальности вокруг игрока появляется маркер и уведомление. - Стандартный HUD GTA (деньги, патроны, район, улица, название машины) один раз убирается за экран при старте, без цикла. Он возвращается, когда ресурс останавливается.
Решение проблем
| Проблема | Решение |
|---|---|
В консоли: [STABLE] esx_status not started или esx_basicneeds not started | Запустите оба до stable_hud или используйте экспорт SetStatus. |
| Голод и жажда не появляются, хотя оба ресурса запущены | Проверьте консоль F8 на ошибки ESX. Если ESX так и не загрузил игрока, esx_status не отправляет значения. |
/announce или /tc ничего не делает | Вашей группы ESX нет в Config.HUD.announce.groups или Config.HUD.teamchat.groups. |
| "Your announcement contains a blocked word." | В сообщении есть слово из Config.HUD.announce.blacklist. |
| "Your message is too long" | Больше maxLength (по умолчанию 200 символов). |
| Нет логов в Discord | Проверьте URL вебхуков в server/config.server.lua. |
| Сломалась раскладка у игрока | Откройте /hud и нажмите сброс. |
::es::
Stable HUD es un HUD para ESX. Los jugadores pueden arrastrar cada parte y cambiar de estilo dentro del juego, y su diseño se guarda en su PC.
Requisitos
| Recurso | Para qué |
|---|---|
es_extended (ESX Legacy 1.14+) | Obligatorio. La única dependencia. |
pma-voice, saltychat o yaca-voice | Opcional. Alcance de voz y lista de radio. |
esx_status + esx_basicneeds | Opcional. Barras de hambre y sed. O usa el export SetStatus. |
Instalación
- Descarga
stable_huddesde el Cfx.re Portal y ponlo en tu carpetaresources. - Añade
ensure stable_huda tuserver.cfg. Ponlo después de ESX, tu script de voz,esx_statusyesx_basicneeds. - Configúralo en
shared/config.hud.luayserver/config.server.lua. - Reinicia el servidor. La consola muestra
[STABLE] HUD V1 LOADED.
Archivos que puedes editar
Estos archivos están abiertos. Todo lo demás está protegido con escrow.
| Archivo | Qué hace |
|---|---|
shared/config.hud.lua | Idioma, nombre y colores del servidor, duración de las notificaciones, /announce (grupos, duración, longitud máx., lista negra), chat de equipo (comando, grupos, longitud máx., cooldown), script de voz, unidad de velocidad, comando y tecla de ajustes, nombres de radio, tecla del chat de comandos, qué partes del HUD están activadas |
server/config.server.lua | URLs de webhooks de Discord para los logs de anuncios y chat de equipo |
locales/*.lua | Todos los textos del HUD, un archivo por idioma |
data/postals.json | Códigos postales (x, y, code). Sustitúyelos por los de tu mapa. |
Configuración
shared/config.hud.lua
Config = Config or {}
-- Official Stable Script config: https://tebex.stable-scripts.store/package/7810767
Config.HUD = {
-- language from locales/ (de, en, es, fr, it, nl, pl, pt, ro, tr), nil = same as es_extended
locale = nil,
branding = {
-- server name / server color
name = 'STABLE',
tag = 'CITY',
color = '#E874FF',
colorDark = '#FFD289', -- if your server has 2 colors use the 2nd one instead of a dark version of the first color
},
-- notification duration in ms
notifyDuration = 5000,
announce = {
command = 'announce',
-- ESX groups allowed to use /announce
groups = {
'owner',
'admin',
},
-- announce duration in ms
duration = 10000,
-- max characters per announce
maxLength = 200,
-- blocked/blacklited words, if someone sends announce with that word it blocks it.
blacklist = {
-- BAD BLOCKED WORDS LIST
'fucking',
'bitch',
'faggot',
},
},
teamchat = {
command = 'tc',
-- ESX groups allowed to write and read the team chat
groups = {
'owner',
'admin',
},
-- max characters per message
maxLength = 200,
-- wait time between two messages per player in ms
cooldown = 500,
},
-- voice script: 'pma-voice', 'saltychat', 'yaca-voice' or false to hide the voice range
voice = 'pma-voice',
-- 'kmh' or 'mph'
speedUnit = 'kmh',
-- settings menu command and default key
settings = {
command = 'hud',
key = 'F10',
},
-- names in the radio list: 'ingame' (ESX character name) or 'fivem'
radioNames = 'ingame',
-- turn parts of the HUD on (true) or off (false)
elements = {
cash = true,
bank = true,
blackMoney = false, -- ESX black_money account under the bank
ammo = true,
location = true, -- postal and street
job = true,
id = true,
players = true,
voice = true,
time = true,
chat = true, -- command chat, key is set below
notifications = true,
lifeinvader = true,
},
-- default key of the command chat, false to disable it
chat = 'T',
}server/config.server.lua
Pega la URL de un webhook de Discord para registrar cada mensaje de /announce o /tc. Déjala en '' para desactivar el log.
Config = Config or {}
Config.Server = {
-- Discord webhook URLs for logs, '' = no log
webhooks = {
-- every /announce with player, ID and message
announce = '', -- https://discord.com/api/webhooks/
-- every /tc team chat message
teamchat = '', -- https://discord.com/api/webhooks/
},
}Activar o desactivar partes
Cada parte tiene un interruptor en Config.HUD.elements. Todo está activado por defecto, excepto el dinero negro.
| Interruptor | Con false |
|---|---|
cash, bank | Oculto. La cuenta no se envía al HUD. |
blackMoney | Desactivado por defecto. Ponlo en true para mostrar black_money de ESX debajo del banco. |
ammo | Oculto. La comprobación de munición no se ejecuta. |
location | Calle, zona y código postal ocultos. |
job | Trabajo y rango ocultos. |
id, players, time | Oculto. |
voice | Alcance de voz oculto. Sin marcador ni notificación al cambiarlo. |
chat | La tecla del chat de comandos no se registra. |
notifications | El export Notify y el evento hud:notify no hacen nada. El chat de equipo y los anuncios se siguen mostrando. |
lifeinvader | El export LifeInvader y su evento no hacen nada. |
Una parte desactivada también desaparece de /hud, así que los jugadores no pueden volver a activarla.
Idiomas
El idioma se elige automáticamente a partir del idioma de ESX (el convar esx:locale). Si no está definido, se usa el idioma de txAdmin y luego el inglés. Para forzar uno, pon en Config.HUD.locale un código de la tabla.
| Idioma | Código | Archivo |
|---|---|---|
en | locales/en.lua | |
de | locales/de.lua | |
es | locales/es.lua | |
fr | locales/fr.lua | |
it | locales/it.lua | |
nl | locales/nl.lua | |
pl | locales/pl.lua | |
pt | locales/pt.lua | |
ro | locales/ro.lua | |
tr | locales/tr.lua |
Para añadir un idioma, copia locales/en.lua, tradúcelo y guárdalo como locales/<código>.lua.
Qué hay en pantalla
La mayoría de las partes tienen varios estilos: el título 3, la fila de info 2, el dinero 3, las notificaciones 3, los anuncios 2, hambre y sed 3, el velocímetro 2. Cada jugador elige los suyos en /hud; por defecto es el estilo 1.
Nombre del servidor e info
El nombre y la etiqueta de tu servidor de Config.HUD.branding, en tus colores. Debajo: alcance de voz, número de jugadores (en línea / sv_maxclients) y el ID del jugador.
Dinero y munición
Efectivo (money), banco (bank) y dinero negro (black_money), en directo desde ESX. El dinero negro está desactivado por defecto; actívalo con Config.HUD.elements.blackMoney. La munición, con el nombre del arma de ESX, aparece mientras llevas un arma en la mano.
Notificaciones y LifeInvader
Notificaciones de info, éxito y error, chat de equipo (azul) y anuncios de LifeInvader con el nombre y el teléfono del remitente.
Anuncios
De /announce, el export Announce y txAdmin. Muestran el nombre del remitente.
Hambre y sed
De esx_status, o de tu propio script de necesidades mediante el export SetStatus.
Velocímetro
Velocidad, marcha y combustible. Elige km/h o mph con Config.HUD.speedUnit.
Textos de ayuda
{E}y[E]se dibujan como una tecla. Los corchetes funcionan con teclas de hasta 5 caracteres, como[E]o[SPACE].- Los códigos de GTA como
~INPUT_CONTEXT~se convierten en la tecla real del jugador. - Los códigos de color como
~g~se eliminan.
Así, los scripts de ESX que ya tienes funcionan sin cambios.
Lista de radio, ubicación y trabajo
La lista de radio muestra la frecuencia y a todos los que están en ella. Quien habla se pone en verde. Config.HUD.radioNames elige 'ingame' (nombre del personaje de ESX) o 'fivem'. Usa la radio de tu script de voz, sin configuración.
La calle, la zona y el código postal aparecen junto al minimapa, con el trabajo y el rango. El trabajo se actualiza en directo con esx:setJob.
Menú de ajustes
Los jugadores lo abren con /hud o F10. Pueden arrastrar cada parte, cambiar el tamaño y elegir un estilo para cada una. Restablecer lo deja todo como al principio.
Comandos
| Comando | Quién | Qué hace |
|---|---|---|
/hud (tecla F10)Config.HUD.settings | Todos | Abre el menú de ajustes. Los jugadores pueden cambiar la tecla en Ajustes de GTA → Asignación de teclas → FiveM. |
TConfig.HUD.chat | Todos | Abre el chat de comandos. Ver abajo. |
/announce <texto>Config.HUD.announce.command | Grupos de Config.HUD.announce.groups, consola del servidor | Anuncio a todos los jugadores con el nombre de FiveM del remitente. |
/tc <texto>Config.HUD.teamchat.command | Grupos de Config.HUD.teamchat.groups | Chat de equipo. Una notificación azul con el nombre de FiveM del remitente. Solo estos grupos pueden enviarlo y leerlo. |
Límites y lista negra
- Longitud máx.:
/announcey/tcpermiten 200 caracteres cada uno (maxLength). Los mensajes más largos se rechazan con una notificación. - Cooldown del chat de equipo: un jugador tiene que esperar 500 ms entre dos mensajes de
/tc(Config.HUD.teamchat.cooldown). - Lista negra: se bloquea un anuncio que contenga una palabra de
Config.HUD.announce.blacklist. No importan mayúsculas ni minúsculas, solo cuentan palabras completas y una entrada puede tener varias palabras. Los anuncios de txAdmin también se revisan; los de la consola del servidor, no.
Chat de comandos
El HUD tiene su propia entrada de comandos, así que no necesitas el recurso chat por defecto.
- Escribe un comando con
/, por ejemplo/announce Hola. Entero el botón de enviar lo ejecuta.- Las flechas recorren los comandos recientes.
Esclo cierra.
Solo ejecuta comandos, no envía mensajes de chat. Quita ensure chat de tu server.cfg, o pon Config.HUD.chat = false (o Config.HUD.elements.chat = false) para mantener el chat por defecto.
Logs de Discord
Configura los webhooks en server/config.server.lua. Cada log es un embed con el color de tu servidor y contiene:
- El mensaje.
- El nombre de FiveM, el ID y el grupo de ESX del jugador.
- Su nombre en el juego (personaje).
- Sus identificadores, sin la dirección IP.
announce registra /announce y los anuncios de txAdmin (como txAdmin (name)). teamchat registra cada mensaje de /tc.
Exports de cliente
-- notification; type 'info' | 'success' | 'error', duration in ms (optional)
exports.stable_hud:Notify('Title', 'Message', 'success', 5000)
-- LifeInvader ad, shown only to this player; sender and duration in ms are optional
exports.stable_hud:LifeInvader('Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- help prompt: call it every frame while it should show, it hides by itself 250 ms after the last call
-- or pass a duration in ms to show it once
exports.stable_hud:HelpNotify('Press {E} to open the garage')
exports.stable_hud:HelpNotify('Press {E} to open the garage', 3000)
exports.stable_hud:HideHelpNotify()
-- hide or show the whole HUD (cutscenes, cameras, photo mode ...)
exports.stable_hud:SetVisible(false)
exports.stable_hud:SetVisible(true)
local visible = exports.stable_hud:IsVisible()
-- hunger and thirst from your own needs script, values 0-100
exports.stable_hud:SetStatus({ hunger = 80, thirst = 55 })El HUD se oculta mientras el menú de pausa está abierto.
Exports de servidor
-- notification for one player
exports.stable_hud:Notify(source, 'Title', 'Message', 'info', 5000)
-- announcement for everyone; title, duration (ms) and author are optional
exports.stable_hud:Announce('Server restart in 10 minutes')
exports.stable_hud:Announce('Server restart in 10 minutes', 'Restart', 15000, 'Admin')
-- LifeInvader ad; target is a player id or -1 for everyone
-- sender as a player id: the RP name is filled in from ESX
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', source)
-- add the phone number from your phone script (optional)
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { source = source, phone = '555-0142' })
-- or set everything yourself
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- hide or show the HUD of one player
exports.stable_hud:SetVisible(source, false)Usar el HUD para todas las notificaciones de ESX
En es_extended/client/functions.lua, sustituye estas dos funciones. Así, cualquier script que use notificaciones o textos de ayuda de ESX los mostrará en el HUD. Eso incluye xPlayer.showNotification en el servidor.
function ESX.ShowNotification(message, notifyType, length, title, position)
return exports.stable_hud:Notify(title or 'Info', message, notifyType or 'info', length)
end
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
return exports.stable_hud:HelpNotify(msg, duration)
endIntegraciones
- txAdmin: los anuncios (con el nombre del admin) y los avisos de reinicio programado se muestran como anuncios del HUD. Para ocultar los popups propios de txAdmin, añade esto a tu
server.cfg:setr txAdmin-hideDefaultAnnouncement true setr txAdmin-hideDefaultScheduledRestartWarning true - esx_status: hambre y sed se actualizan cada segundo.
- Voz (
pma-voice,saltychat,yaca-voice): elígela conConfig.HUD.voice, o ponfalsepara ocultar el alcance de voz. Al cambiar el alcance, aparece un marcador alrededor del jugador junto con una notificación. - El HUD propio de GTA (dinero, munición, zona, calle, nombre del vehículo) se saca de la pantalla una vez al iniciar, sin bucle. Vuelve cuando el recurso se detiene.
Solución de problemas
| Problema | Solución |
|---|---|
Consola: [STABLE] esx_status not started o esx_basicneeds not started | Inicia ambos antes de stable_hud, o usa el export SetStatus. |
| Hambre y sed no aparecen nunca, aunque ambos están en marcha | Revisa la consola F8 por errores de ESX. Si ESX nunca termina de cargar al jugador, esx_status nunca envía valores. |
/announce o /tc no hace nada | Tu grupo de ESX no está en Config.HUD.announce.groups o Config.HUD.teamchat.groups. |
| «Tu anuncio contiene una palabra bloqueada.» | El mensaje tiene una palabra de Config.HUD.announce.blacklist. |
| «Tu mensaje es demasiado largo» | Supera maxLength (200 caracteres por defecto). |
| No hay logs de Discord | Revisa las URLs de los webhooks en server/config.server.lua. |
| El diseño de un jugador está roto | Abre /hud y pulsa Restablecer. |
::it::
Stable HUD è un HUD per ESX. I giocatori possono trascinare ogni parte e cambiare stile in gioco, e il loro layout viene salvato sul loro PC.
Requisiti
| Risorsa | A cosa serve |
|---|---|
es_extended (ESX Legacy 1.14+) | Obbligatoria. L'unica dipendenza. |
pma-voice, saltychat o yaca-voice | Opzionale. Raggio della voce e lista radio. |
esx_status + esx_basicneeds | Opzionale. Barre di fame e sete. Oppure usa l'export SetStatus. |
Installazione
- Scarica
stable_huddal Cfx.re Portal e mettilo nella cartellaresources. - Aggiungi
ensure stable_hudal tuoserver.cfg. Mettilo dopo ESX, il tuo script vocale,esx_statusedesx_basicneeds. - Configuralo in
shared/config.hud.luaeserver/config.server.lua. - Riavvia il server. La console mostra
[STABLE] HUD V1 LOADED.
File che puoi modificare
Questi file sono aperti. Tutto il resto è protetto da escrow.
| File | Cosa fa |
|---|---|
shared/config.hud.lua | Lingua, nome e colori del server, durata delle notifiche, /announce (gruppi, durata, lunghezza max, blacklist), chat di team (comando, gruppi, lunghezza max, cooldown), script vocale, unità di velocità, comando e tasto delle impostazioni, nomi radio, tasto della chat comandi, quali parti dell'HUD sono attive |
server/config.server.lua | URL dei webhook Discord per i log di annunci e chat di team |
locales/*.lua | Tutti i testi dell'HUD, un file per lingua |
data/postals.json | Codici postali (x, y, code). Sostituiscili con quelli della tua mappa. |
Configurazione
shared/config.hud.lua
Config = Config or {}
-- Official Stable Script config: https://tebex.stable-scripts.store/package/7810767
Config.HUD = {
-- language from locales/ (de, en, es, fr, it, nl, pl, pt, ro, tr), nil = same as es_extended
locale = nil,
branding = {
-- server name / server color
name = 'STABLE',
tag = 'CITY',
color = '#E874FF',
colorDark = '#FFD289', -- if your server has 2 colors use the 2nd one instead of a dark version of the first color
},
-- notification duration in ms
notifyDuration = 5000,
announce = {
command = 'announce',
-- ESX groups allowed to use /announce
groups = {
'owner',
'admin',
},
-- announce duration in ms
duration = 10000,
-- max characters per announce
maxLength = 200,
-- blocked/blacklited words, if someone sends announce with that word it blocks it.
blacklist = {
-- BAD BLOCKED WORDS LIST
'fucking',
'bitch',
'faggot',
},
},
teamchat = {
command = 'tc',
-- ESX groups allowed to write and read the team chat
groups = {
'owner',
'admin',
},
-- max characters per message
maxLength = 200,
-- wait time between two messages per player in ms
cooldown = 500,
},
-- voice script: 'pma-voice', 'saltychat', 'yaca-voice' or false to hide the voice range
voice = 'pma-voice',
-- 'kmh' or 'mph'
speedUnit = 'kmh',
-- settings menu command and default key
settings = {
command = 'hud',
key = 'F10',
},
-- names in the radio list: 'ingame' (ESX character name) or 'fivem'
radioNames = 'ingame',
-- turn parts of the HUD on (true) or off (false)
elements = {
cash = true,
bank = true,
blackMoney = false, -- ESX black_money account under the bank
ammo = true,
location = true, -- postal and street
job = true,
id = true,
players = true,
voice = true,
time = true,
chat = true, -- command chat, key is set below
notifications = true,
lifeinvader = true,
},
-- default key of the command chat, false to disable it
chat = 'T',
}server/config.server.lua
Incolla l'URL di un webhook Discord per registrare ogni messaggio /announce o /tc. Lascia '' per disattivare il log.
Config = Config or {}
Config.Server = {
-- Discord webhook URLs for logs, '' = no log
webhooks = {
-- every /announce with player, ID and message
announce = '', -- https://discord.com/api/webhooks/
-- every /tc team chat message
teamchat = '', -- https://discord.com/api/webhooks/
},
}Attivare o disattivare le parti
Ogni parte ha un interruttore in Config.HUD.elements. Di default è tutto attivo, tranne i soldi sporchi.
| Interruttore | Con false |
|---|---|
cash, bank | Nascosto. Il conto non viene inviato all'HUD. |
blackMoney | Disattivato di default. Impostalo su true per mostrare black_money di ESX sotto la banca. |
ammo | Nascosto. Il controllo delle munizioni non parte. |
location | Via, zona e codice postale nascosti. |
job | Lavoro e grado nascosti. |
id, players, time | Nascosto. |
voice | Raggio della voce nascosto. Nessun marker né notifica al cambio. |
chat | Il tasto della chat comandi non viene registrato. |
notifications | L'export Notify e l'evento hud:notify non fanno nulla. Chat di team e annunci vengono comunque mostrati. |
lifeinvader | L'export LifeInvader e il suo evento non fanno nulla. |
Una parte disattivata sparisce anche da /hud, quindi i giocatori non possono riattivarla.
Lingue
La lingua viene scelta automaticamente dalla lingua di ESX (il convar esx:locale). Se non è impostata, si usa la lingua di txAdmin, poi l'inglese. Per forzarne una, imposta Config.HUD.locale su un codice della tabella.
| Lingua | Codice | File |
|---|---|---|
en | locales/en.lua | |
de | locales/de.lua | |
es | locales/es.lua | |
fr | locales/fr.lua | |
it | locales/it.lua | |
nl | locales/nl.lua | |
pl | locales/pl.lua | |
pt | locales/pt.lua | |
ro | locales/ro.lua | |
tr | locales/tr.lua |
Per aggiungere una lingua, copia locales/en.lua, traducilo e salvalo come locales/<codice>.lua.
Cosa c'è sullo schermo
Quasi tutte le parti hanno più stili: titolo 3, riga info 2, soldi 3, notifiche 3, annunci 2, fame e sete 3, tachimetro 2. Ogni giocatore sceglie i suoi in /hud; quello predefinito è lo stile 1.
Nome del server e info
Il nome e il tag del tuo server da Config.HUD.branding, nei tuoi colori. Sotto: raggio della voce, numero di giocatori (online / sv_maxclients) e l'ID del giocatore.
Soldi e munizioni
Contanti (money), banca (bank) e soldi sporchi (black_money), in tempo reale da ESX. I soldi sporchi sono disattivati di default; attivali con Config.HUD.elements.blackMoney. Le munizioni, con il nome dell'arma di ESX, appaiono mentre hai un'arma in mano.
Notifiche e LifeInvader
Notifiche di info, successo ed errore, chat di team (blu) e annunci LifeInvader con nome e numero di telefono del mittente.
Annunci
Da /announce, dall'export Announce e da txAdmin. Mostrano il nome del mittente.
Fame e sete
Da esx_status, oppure dal tuo script dei bisogni tramite l'export SetStatus.
Tachimetro
Velocità, marcia e carburante. Scegli km/h o mph con Config.HUD.speedUnit.
Testi di aiuto
{E}e[E]vengono mostrati come un tasto. Le parentesi quadre funzionano per tasti fino a 5 caratteri, come[E]o[SPACE].- I codici GTA come
~INPUT_CONTEXT~diventano il vero tasto del giocatore. - I codici colore come
~g~vengono rimossi.
Così gli script ESX esistenti funzionano senza modifiche.
Lista radio, posizione e lavoro
La lista radio mostra la frequenza e chi c'è sopra. Chi parla diventa verde. Config.HUD.radioNames sceglie 'ingame' (nome del personaggio ESX) o 'fivem'. Usa la radio del tuo script vocale, senza configurazione.
Via, zona e codice postale stanno accanto alla minimappa, con il lavoro e il grado. Il lavoro si aggiorna in tempo reale su esx:setJob.
Menu impostazioni
I giocatori lo aprono con /hud o F10. Possono trascinare ogni parte, cambiarne la dimensione e scegliere uno stile per ognuna. Ripristina rimette tutto com'era.
Comandi
| Comando | Chi | Cosa fa |
|---|---|---|
/hud (tasto F10)Config.HUD.settings | Tutti | Apre il menu impostazioni. I giocatori possono cambiare il tasto in Impostazioni di GTA → Assegnazione tasti → FiveM. |
TConfig.HUD.chat | Tutti | Apre la chat comandi. Vedi sotto. |
/announce <testo>Config.HUD.announce.command | Gruppi in Config.HUD.announce.groups, console del server | Annuncio a tutti i giocatori con il nome FiveM del mittente. |
/tc <testo>Config.HUD.teamchat.command | Gruppi in Config.HUD.teamchat.groups | Chat di team. Una notifica blu con il nome FiveM del mittente. Solo questi gruppi possono inviarla e leggerla. |
Limiti e blacklist
- Lunghezza max:
/announcee/tcaccettano 200 caratteri ciascuno (maxLength). I messaggi più lunghi vengono rifiutati con una notifica. - Cooldown della chat di team: un giocatore deve aspettare 500 ms tra due messaggi
/tc(Config.HUD.teamchat.cooldown). - Blacklist: un annuncio che contiene una parola di
Config.HUD.announce.blacklistviene bloccato. Maiuscole e minuscole non contano, valgono solo parole intere e una voce può contenere più parole. Anche gli annunci di txAdmin vengono controllati, quelli dalla console del server no.
Chat comandi
L'HUD ha un proprio campo per i comandi, quindi non ti serve la risorsa chat predefinita.
- Scrivi un comando con
/, per esempio/announce Ciao. Invioo il pulsante di invio lo esegue.- Le frecce scorrono i comandi recenti.
Escla chiude.
Esegue solo comandi, non invia messaggi in chat. Togli ensure chat dal tuo server.cfg, oppure imposta Config.HUD.chat = false (o Config.HUD.elements.chat = false) per tenere la chat predefinita.
Log Discord
Imposta i webhook in server/config.server.lua. Ogni log è un embed nel colore del tuo server con:
- Il messaggio.
- Nome FiveM, ID e gruppo ESX del giocatore.
- Il suo nome in gioco (personaggio).
- I suoi identificatori, senza indirizzo IP.
announce registra /announce e gli annunci di txAdmin (mostrati come txAdmin (name)). teamchat registra ogni messaggio /tc.
Export client
-- notification; type 'info' | 'success' | 'error', duration in ms (optional)
exports.stable_hud:Notify('Title', 'Message', 'success', 5000)
-- LifeInvader ad, shown only to this player; sender and duration in ms are optional
exports.stable_hud:LifeInvader('Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- help prompt: call it every frame while it should show, it hides by itself 250 ms after the last call
-- or pass a duration in ms to show it once
exports.stable_hud:HelpNotify('Press {E} to open the garage')
exports.stable_hud:HelpNotify('Press {E} to open the garage', 3000)
exports.stable_hud:HideHelpNotify()
-- hide or show the whole HUD (cutscenes, cameras, photo mode ...)
exports.stable_hud:SetVisible(false)
exports.stable_hud:SetVisible(true)
local visible = exports.stable_hud:IsVisible()
-- hunger and thirst from your own needs script, values 0-100
exports.stable_hud:SetStatus({ hunger = 80, thirst = 55 })L'HUD si nasconde mentre il menu di pausa è aperto.
Export server
-- notification for one player
exports.stable_hud:Notify(source, 'Title', 'Message', 'info', 5000)
-- announcement for everyone; title, duration (ms) and author are optional
exports.stable_hud:Announce('Server restart in 10 minutes')
exports.stable_hud:Announce('Server restart in 10 minutes', 'Restart', 15000, 'Admin')
-- LifeInvader ad; target is a player id or -1 for everyone
-- sender as a player id: the RP name is filled in from ESX
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', source)
-- add the phone number from your phone script (optional)
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { source = source, phone = '555-0142' })
-- or set everything yourself
exports.stable_hud:LifeInvader(-1, 'Selling Sultan RS, call me', { name = 'John Doe', phone = '555-0142' }, 8000)
-- hide or show the HUD of one player
exports.stable_hud:SetVisible(source, false)Usare l'HUD per tutte le notifiche ESX
In es_extended/client/functions.lua, sostituisci queste due funzioni. Così ogni script che usa notifiche o testi di aiuto ESX li mostra nell'HUD. Vale anche per xPlayer.showNotification sul server.
function ESX.ShowNotification(message, notifyType, length, title, position)
return exports.stable_hud:Notify(title or 'Info', message, notifyType or 'info', length)
end
function ESX.ShowHelpNotification(msg, thisFrame, beep, duration)
return exports.stable_hud:HelpNotify(msg, duration)
endIntegrazioni
- txAdmin: gli annunci (con il nome dell'admin) e gli avvisi di riavvio programmato appaiono come annunci dell'HUD. Per nascondere i popup di txAdmin, aggiungi questo al tuo
server.cfg:setr txAdmin-hideDefaultAnnouncement true setr txAdmin-hideDefaultScheduledRestartWarning true - esx_status: fame e sete si aggiornano ogni secondo.
- Voce (
pma-voice,saltychat,yaca-voice): sceglila conConfig.HUD.voice, oppure impostafalseper nascondere il raggio della voce. Quando il raggio cambia, appare un marker intorno al giocatore con una notifica. - L'HUD di GTA (soldi, munizioni, zona, via, nome del veicolo) viene spostato fuori schermo una volta all'avvio, senza loop. Torna quando la risorsa si ferma.
Risoluzione dei problemi
| Problema | Soluzione |
|---|---|
Console: [STABLE] esx_status not started o esx_basicneeds not started | Avvia entrambi prima di stable_hud, oppure usa l'export SetStatus. |
| Fame e sete non appaiono mai, ma entrambi sono avviati | Controlla la console F8 per errori di ESX. Se ESX non finisce mai di caricare il giocatore, esx_status non invia mai valori. |
/announce o /tc non fa nulla | Il tuo gruppo ESX non è in Config.HUD.announce.groups o Config.HUD.teamchat.groups. |
| "Il tuo annuncio contiene una parola bloccata." | Il messaggio contiene una parola di Config.HUD.announce.blacklist. |
| "Il tuo messaggio è troppo lungo" | Supera maxLength (200 caratteri di default). |
| Nessun log su Discord | Controlla gli URL dei webhook in server/config.server.lua. |
| Il layout di un giocatore è rotto | Apri /hud e premi Ripristina. |