ai-hud
The HUD and the character's needs. Health, armour, hunger, thirst, stress, money, job, speedometer, street name, voice and key hints.
ai-hud draws the HUD and keeps the character's needs: hunger, thirst and stress. Hunger and thirst drop over time and food and drink fill them up; stress grows from shooting and fast driving and fades by itself.
What it does in the game
- Status pills. Health, armour, hunger, thirst and stress.
- Money. Cash and bank, top right.
- Name and job. The job (the on-duty job, else the first one) with its grade, the server id and the character name, top right. "Off duty" shows when the player is not on duty.
- Weapon box. While a weapon is held: its name, picture and rounds, under the money.
- Speedometer. In a vehicle: speed, gear, fuel and the seatbelt warning.
- Street and area next to the minimap.
- Voice. The microphone, the voice range, talking and the radio (needs ai-voice or pma-voice).
- Key hints. On the left, the keys of what the player can do now (on foot or in a vehicle).
- Minimap. Always, or only in a vehicle, as the panel says. GTA's own health and armour bars under it are hidden.
- Hides itself without a character, in the pause menu, during screen fades and while a full-screen menu is open.
- Player settings.
/hudor the radial menu's HUD settings entry: each player turns parts of the HUD off for themselves. A part the panel turns off stays off.
How the needs work
- Hunger and thirst go from 100 (full) down to 0. Stress goes from 0 (calm) up to 100.
- Every minute of play, hunger and thirst drop and stress fades by the panel's amounts.
- While hunger or thirst is at 0, the character loses health every 10 seconds.
- Shooting and driving fast add stress.
- Food, drink and other items change the needs by their Hunger, Thirst and Stress values in the inventory's item settings (ai-inventory).
- Needs are saved on the character (QB's
hunger,thirst,stressmetadata keys), so QB scripts read them too.
Installation
The AI Core txAdmin recipe installs it. By hand: put the folder in resources/[ai]/ and add ensure ai-hud to server.cfg after ensure ai-core. It needs ai-core. It has no database table of its own.
Run only one HUD. AI Core does not report two HUDs running at once.
Panel settings
Open the admin panel (F10) and pick HUD. Everything is on one tab, HUD and needs.
Needs: hunger and thirst drop over time; food and drink items fill them up.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Hunger drop | Points lost every minute from 100. 0.25 empties in about 6.5 hours of play. | 0 to 10 per min | 0.25 |
| Thirst drop | Points lost every minute from 100. | 0 to 10 per min | 0.35 |
| Stress fade | Stress points that fade every minute. | 0 to 10 per min | 0.5 |
| Stress speed | Driving faster than this may add a stress point. 0 turns it off. | 0 to 500 km/h | 160 |
| Speed stress chance | Chance per speed change above the stress speed to add a point. | 0 to 100 % | 1 |
| Stress per shot | Points a shot adds, at most once a second. 0 turns it off. | 0 to 5 | 1 |
| Damage when empty | Health lost every 10 seconds while food or water is at 0. 0 turns it off. | 0 to 50 HP | 2 |
What the HUD shows: parts of the HUD players see while playing.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Health and needs | The status pills. | on / off | on |
| Money | Cash and bank. | on / off | on |
| Speedometer | The gauge in vehicles. | on / off | on |
| Street name | Street and area. | on / off | on |
| Voice | Microphone and voice range (needs ai-voice or pma-voice). | on / off | on |
| Name and job | Top right: the job, its grade, the server id and the character name. | on / off | on |
| Speed unit | Unit of the speedometer. | km/h / mph | km/h |
Map and key hints: when the minimap shows and the key list on the left of the screen.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Minimap | Always, or Only in a vehicle. | Always / Only in a vehicle | Only in a vehicle |
| Key hints | The keys of what the player can do now, on the left of the screen. Which keys show, and when, is set per key in the Keybinds tab. | on / off | on |
Commands
| Command | Arguments | Who | What it does |
|---|---|---|---|
/hud | none | everyone | Opens the HUD settings: one switch per HUD part and the key hints, kept for this player. |
Keybinds
None of its own. The key hints it shows come from every script's keybinds.
Works with other scripts
- Fuel from any fuel script that sets the vehicle's
fuelstate bag (ai-fuel, and others through AI Core's fuel layer). - Seatbelt through AI Core's seatbelt layer (ai-smallresources and other seatbelt scripts).
- Voice from ai-voice or pma-voice.
- Needs from items of any inventory that defines hunger, thirst or stress values (AI Core's item use event).
- Stress from other scripts through AI Core's stress layer (lib
stress), which calls ai-hud. - You can replace it. AI Core hides and shows other HUDs (tgiann-lumihud, jg-hud, 0r-hud-v3, codem-supreme-hud, qb-hud, ps-hud and more) and opens their settings from the radial menu. See Compatibility.
Known limits
- Stress from the client is limited to 1 to 5 points per report and two reports a second; everything else is decided on the server.
- The minimap mode is the owner's choice: players cannot change it in
/hud. An admin can keep it on foot for themselves from the ai-admin menu.