NPC Pro – talking, remembering street NPCs with trust, gossip and errands NPC PRO - talk to ANY ped. They remember, they gossip, they snitch. €29.99 See NPC PRO
Client exports (82)

Documentation

nCore Vibe HUD – roleplay HUD with wanted icons, vehicle card, built-in chat documentation

v1.0.12 Updated 5 sections · 7 min
On this page
  1. Client exports (82)
  2. Server exports (17)
  3. Events
  4. Convars
  5. Saved data

This is the reference for script authors. README.md is the overview and INSTALLATION.md the setup guide. Every setting is explained by the comments in config.lua.

Call the client exports as exports.ncore_vibehud:Name(...) from a client script, and the server exports the same way from a server script. Most setters return true when they did something and false when they couldn't (an unknown name, a part switched off in config, no vehicle).

Client exports (82)#

HUD and parts#

Export What it does
SetHudVisible(on, reason) Hides or shows the whole HUD for a reason of your own. Several scripts can hide it at once, it comes back when every reason is cleared
IsHudVisible() true while the HUD is on screen
SetHudEnabled(on) Turns the HUD off or on
IsPlayerReady() true once the character is loaded and in the world
ShowElement(name), HideElement(name), ToggleElement(name), SetElementVisible(name, on), IsElementVisible(name) One part of the HUD. The names are the ones on the Parts page: stats, tooltip, wanted, suspect, money, vehicle, location, minimap, subtitle, status, prompts, medicine
GetHudState() The table the HUD draws from
ResyncHud() Sends everything to the page again
GetFramework() esx, qb, qbox or standalone

Stats and needs#

Export What it does
SetStat(name, value, max) Overrides a bar. Names: health, armour, stamina, oxygen, ability, hunger, thirst, stress
SetStatMax(name, max) Overrides the max of a bar, nil goes back to automatic
SetStatSegments(name, segments) Divider segments, a number or a table, nil goes back to automatic
ClearStatOverride(name) Gives a bar back to the game. Without a name it clears every override
GetStats() The current values
SetNeed(key, value) Feeds hunger, thirst or stress, 0 to 100 (a value from 0 to 1 is read as a fraction). nil removes the value and the bar hides
GetNeeds() The current needs

Wanted level and suspect icons#

Export What it does
SetWanted(level, kind) Stars 0 to 6. kind is normal, searching, losing or possible
ClearWantedOverride() Back to the game's wanted level
SetSuspect(tbl) Lights the evidence icons, for example { cctv = true, weapon = false }. Keys: cctv, group, appearance, profile, weapon, vehicle
ClearSuspectOverride() Back to the live checks

Money#

Export What it does
SetMoney(rows) { cash = 500, bank = 12000 }, or a list of { id = 'cash', amount = 500 } rows
SetMoneyRow(id, amount, color) One row, also a new one with your own id and color

Special ability#

Export What it does
SetAbilityCharacter(name) focus, rage or off
ChargeAbility(amount) Adds charge (the bar runs 0 to 100)
GetAbility() { charge, active, enabled, character }

Vehicle#

Export What it does
SetIndicator(mode), GetIndicator() 0 off, 1 left, 2 right, 3 hazards
SetSeatbelt(on), IsSeatbeltOn(), IsHarnessOn() Belt and racing harness
SetCruise(speed), GetCruise() Speed in the player's unit, 0 releases
SetSpeedLimiter(speed), GetSpeedLimiter() Speed in the player's unit, 0 clears
SetParkBrake(on), GetGearboxState() Sets the parking brake. The state comes back as { mode, parkBrake, selected, gear }, where selected is the badge letter P, R, N or D
SetVehicleCard(tbl), ClearVehicleCard() Overrides the card. Fields: manufacturer, model, fuel, health, body, speed, unit, gear, rpm (0 to 1), kind, altitude, lights, engine, locked, belt, harness, indicator, park, limit, cruise. Fields you leave out keep their live value

While ncore_hud runs and Config.Siblings.notifyVehicle is on, ncore_hud owns the indicators, belt, cruise, parking brake and limiter, and the setters above return false. Call ncore_hud's exports instead.

Location and minimap#

Export What it does
SetLocation(text, kind), ClearLocation() Overrides the location card, kind is land or water
GetPostal() The nearest postal code
SetGps(on) Shows or hides the waypoint distance, nil goes back to following the waypoint
SetMinimapBlips(list) Dots on the minimap frame: { x, y, size, color }, x and y in frame pixels, size small, large or a number

Screen messages and mission panel#

Export What it does
SetTooltip(text, ms), ClearTooltip() The help box
SetSubtitle(text, kind, ms), Objective(text, ms), ClearSubtitle() Subtitle line, or the objective line with kind = 'objective'. GTA color codes work
SetStatus(tbl) The mission panel. Fields: label, value, racePos, raceTotal, par, medal (gold, silver, bronze), timerSize (56 or 37), showLabel, showRace, showTimer, showPar, timer = { running, ms, countdown }
StartTimer(ms, countdown), StopTimer() Counts up from ms, or down with countdown = true
SetRace(pos, total), SetPar(par, medal), ClearStatus() Race position, par time and medal, and clearing the panel
ShowPrompt(id, tbl) A hold-to-interact prompt. Fields: label, button (the key cap text, E by default), control (the control to hold), holdMs, onHold (a function, or a client event name that gets the id)
SetPromptHold(id, value), HidePrompt(id), ClearPrompts() Fill the ring yourself (0 to 1), hide one prompt, hide all

Wheel and items#

Export What it does
OpenWheel(), CloseWheel(), IsWheelOpen() The weapon and item wheel
GetWheelKey() The key label, nil when the wheel is off
SetMedicine(items) Your own quick-use cards: a list of { label, count, button, boost, selected }, boost is default or fortify. nil goes back to the real items
UseQuickSlot(index) Uses the item on quick slot 1, 2 and so on
GetInventoryBackend() The inventory it found, for example ox_inventory, qb or standalone

Chat#

Export What it does
AddChatMessage(author, text, color, kind) A line in the built-in chat, color like rgb(255,133,188)
IgnorePlayer(id) Toggles a local mute
OpenChat(), CloseChat(), ClearChat() The chat input and history

Settings, debug and demo#

Export What it does
OpenSettings(page), CloseSettings() Pages: general, vehicle, radar, parts, chat, keys
SetSetting(key, value) Keys: hud, scale, unit, sounds, beltChime, indicatorTick, radar, ability, timestamps, showIds, channels, and element with { name, on }
GetSettings() The player's current choices
OpenDebug(), CloseDebug(), ToggleDebug() The debug panel
RunDemo(), StopDemo() The guided tour from /vibehuddemo

Server exports (17)#

src is a player id. -1 sends to everyone, except for Money.

Export What it does
Subtitle(src, text, kind, ms), Objective(src, text, ms), Tooltip(src, text, ms) Screen messages
Status(src, tbl) The mission panel, same fields as SetStatus
Prompt(src, id, tbl), HidePrompt(src, id) Prompts. From the server onHold has to be a client event name
Money(src, rows) Same rows as SetMoney
ChatMessage(src, author, text, color, kind) A chat line for one player or everyone
Announce(text) A server announcement in chat
GetFramework(), GetInventoryBackend() What it detected
AddItem(src, name, count, label), RemoveItem(src, name, count), GetItems(src), GetItemCount(src, name), SetItems(src, list) The standalone item store. These only work while the inventory backend is standalone (no inventory found, or Config.Inventory = 'standalone')
RegisterUsableItem(name, fn) Makes a standalone item usable. fn(src, name) runs on use. Return false to keep the item, otherwise one is used up

Events#

Server to client, with TriggerClientEvent(name, src, ...):

Event Arguments
ncore_vibehud:setWanted / ncore_vibehud:clearWanted level, kind / none
ncore_vibehud:setMoney rows
ncore_vibehud:setNeed key, value
ncore_vibehud:addChatMessage author, text, color, kind
ncore_vibehud:setHudVisible on, reason
ncore_vibehud:setMinimapBlips list
ncore_vibehud:setSubtitle, ncore_vibehud:objective, ncore_vibehud:setTooltip text, kind, ms / text, ms / text, ms
ncore_vibehud:setStatus, ncore_vibehud:startTimer, ncore_vibehud:stopTimer tbl / ms, countdown / none
ncore_vibehud:showPrompt, ncore_vibehud:hidePrompt id, tbl / id

Local client events you can listen to with AddEventHandler:

Event Arguments
ncore_vibehud:playerReady on, when the character becomes ready or stops being ready
ncore_vibehud:spawned none, each time the player becomes ready
ncore_vibehud:visible on, when the HUD shows or hides
ncore_vibehud:nuiReady none, when the page has loaded
ncore_vibehud:seat vehicle, seat, isDriver
ncore_vibehud:seatbelt, ncore_vibehud:parkBrake on
ncore_vibehud:cruise, ncore_vibehud:limiter the set speed, 0 when released
ncore_vibehud:settingChanged key, value ('reset', true after a reset)
ncore_vibehud:layout the screen layout, each time it is worked out again (resolution, safe zone or scale)

Server side, for the built-in chat:

  • Before a typed line, /ooc, /looc or /a goes out, the stock chatMessage event fires with source, name, text. CancelEvent() in your handler blocks the line.
  • After every line, ncore_vibehud:chat:message fires with source, kind, text, targets, so you can log or forward it.

Convars#

Convar Used for
locale With Config.Locale = 'auto', the first two letters pick the language. Set it with setr so players get it too
inventory:imagepath ox_inventory's own image path, read for item and weapon pictures
inventory:keys ox_inventory's hotbar keys, read to warn when its hotbar shares TAB with the wheel
ncore_vibehud:debug true or false turns Config.Debug.console on or off and wins over the config value. Set it with setr so players get it too

Saved data#

Player choices (settings, scale, ability, quick slots, hidden parts and stat progression) are saved on the player's machine. The standalone item store is saved in the server's resource storage, one entry per license. Vibe HUD uses no database.