AI Core

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. /hud or 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, stress metadata 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.

SettingWhat it changesValuesDefault
Hunger dropPoints lost every minute from 100. 0.25 empties in about 6.5 hours of play.0 to 10 per min0.25
Thirst dropPoints lost every minute from 100.0 to 10 per min0.35
Stress fadeStress points that fade every minute.0 to 10 per min0.5
Stress speedDriving faster than this may add a stress point. 0 turns it off.0 to 500 km/h160
Speed stress chanceChance per speed change above the stress speed to add a point.0 to 100 %1
Stress per shotPoints a shot adds, at most once a second. 0 turns it off.0 to 51
Damage when emptyHealth lost every 10 seconds while food or water is at 0. 0 turns it off.0 to 50 HP2

What the HUD shows: parts of the HUD players see while playing.

SettingWhat it changesValuesDefault
Health and needsThe status pills.on / offon
MoneyCash and bank.on / offon
SpeedometerThe gauge in vehicles.on / offon
Street nameStreet and area.on / offon
VoiceMicrophone and voice range (needs ai-voice or pma-voice).on / offon
Name and jobTop right: the job, its grade, the server id and the character name.on / offon
Speed unitUnit of the speedometer.km/h / mphkm/h

Map and key hints: when the minimap shows and the key list on the left of the screen.

SettingWhat it changesValuesDefault
MinimapAlways, or Only in a vehicle.Always / Only in a vehicleOnly in a vehicle
Key hintsThe 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 / offon

Commands

CommandArgumentsWhoWhat it does
/hudnoneeveryoneOpens 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 fuel state 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.

On this page