NX CreativeNX CreativeDocs
Scriptsnx_hud

Commands

Keybinds, player commands, HUD placement commands, and the admin commands for the inventory, targeting and zones in nx_hud.

Keybinds

Every key below is registered with FiveM, so players can rebind it in Settings, Key Bindings, FiveM. The defaults come from the config files and convars named in the table.

Default keySettingAction
F7noneOpen the HUD preferences. F7, Esc or Done closes them.
BConfig.vehicle.seatbelt.keyBuckle or unbuckle the seatbelt.
Left, RightConfig.vehicle.indicators.keysLeft and right turn signal. Driver only.
DownConfig.vehicle.indicators.keysHazard lights. Driver only.
GCompat.radialKeyOpen the radial menu.
XnoneCancel the current progress bar, when the script allows it.
F2inventory:keysOpen the inventory.
Kinventory:keysOpen a nearby trunk, dumpster or stash. Off when NxInventory.secondaryKey is false; the glovebox is then in the radial menu.
TABinventory:keysShow or hide the hotbar. Does nothing while the HUD is hidden.
1 to 5noneUse the item in that hotbar slot. Does nothing while the HUD is hidden.
RnoneReload the weapon in hand.
Left Altox_target:defaultHotkeyTargeting.
EnoneUse the selected target option.
BackspacenoneGo back one target menu.

The seatbelt and indicator keys do nothing while a menu or another page holds the mouse, and the seatbelt key does nothing while a seatbelt script owns the belt.

Player commands

/hudprefseveryone

Open or close the HUD preferences: vehicle mode, cluster face, glass, units, radar shape and zoom, prompts and progress, the radial menu, interface sounds and targeting. Bound to F7. Choices are saved on the player's PC.

/hudbelteveryone

Buckle or unbuckle nx_hud's own seatbelt. Bound to B. It does nothing when Config.vehicle.seatbelt.enabled is false or a seatbelt script owns the belt.

/hudlefteveryone

Left turn signal on or off. Bound to the left arrow. hudright and hudhazard work the same way for the right signal (right arrow) and the hazard lights (down arrow).

/stealeveryone

Search the closest player, when that player can be searched. Turn it off with setr inventory:enablestealcommand false.

/ox_libeveryone

Open the ox_lib settings, where players choose their language and other lib preferences.

HUD placement

These run on the player's own client. Players with an unusual screen use them to fit the radar, and server staff use them to diagnose the HUD. The F7 preferences cover the everyday choices.

/hud radar <shape>everyone

Switch the radar shape for this session. The F7 setting is the one that is saved.

Arguments

  • shapestring— 'square', 'squircle' (Soft in F7), 'circle' (Round in F7) or 'auto'.
/hud radar nudge <dx> <dy>everyone

Move the radar, and the island and gauges with it, by a small amount. Each call adds to the last. /hud radar nudge reset puts it back. Saved for the player.

Arguments

  • dxnumber— Thousandths of the screen width. Positive moves right.
  • dynumber— Thousandths of the screen height. Positive moves down.
/hud radar nudge 4 -2
/hud radar nudge reset
/hud radar edge <state>everyone

On screens wider than 16:9, 'on' (the default) puts the radar at the left edge of the screen and 'off' keeps it inside the centred 16:9 area. Saved for the player.

Arguments

  • statestring— 'on' or 'off'.
/hud radar airzoom <state>everyone

Whether the radar widens with altitude in helicopters and planes. On by default. Lasts for this session.

Arguments

  • statestring— 'on' or 'off'.
/hud diageveryone

Check the radar's placement for 12 seconds. A red outline marks where the radar should be and a cyan one where the HUD drew it; both should sit on the map. The resolution, aspect ratio, safe zone and the radar's position are printed to F8.

/hud ws [state]everyone

The windscreen HUD in first person. On by default. Lasts for this session.

Arguments

  • state?string— 'on' or 'off'. Leave it out to switch.
/hud bridgeeveryone

Print to F8 which framework, fuel and seatbelt adapters the HUD reads, the current status values, and the fuel of the vehicle you are in.

Inventory admin commands

These are ox_inventory's admin commands, with the same names and arguments. The commands marked group.admin are open to that group by default; grant other groups the matching command.<name> ACE.

/additem <target> <item> [count] [type]group.admin

Give an item to a player. Also available as giveitem.

Arguments

  • targetplayer id— The player to receive the item.
  • itemstring— The item name.
  • count?number— Defaults to 1.
  • type?string— Sets the item's "type" metadata.
/removeitem <target> <item> [count] [type]group.admin

Take an item from a player.

Arguments

  • targetplayer id— The player to take the item from.
  • itemstring— The item name.
  • count?number— Defaults to 1. Takes what the player has when they hold fewer.
  • type?string— Only items with this "type" metadata.
/setitem <target> <item> [count] [type]group.admin

Set how many of an item a player has, adding or removing as needed.

Arguments

  • targetplayer id— The player.
  • itemstring— The item name.
  • count?number— Defaults to 0.
  • type?string— Only items with this "type" metadata.
/takeinv <target>group.admin

Confiscate a player's inventory, to give back later with restoreinv.

Arguments

  • targetplayer id— The player.
/restoreinv <target>group.admin

Give back an inventory confiscated with takeinv. Also available as returninv.

Arguments

  • targetplayer id— The player.
/clearinv <invId>group.admin

Delete every item in an inventory.

Arguments

  • invIdstring— The inventory id, a player id, or 'me'.
/saveinv [lock]group.admin

Save every pending inventory change to the database now.

Arguments

  • lock?string— 'true' keeps the inventory locked after the save, until a restart or a save without it.
/viewinv <invId>group.admin

Look inside an inventory without being able to move anything.

Arguments

  • invIdstring— The inventory id or a player id.
/clearevidence <locker>police boss grade

Empty a police evidence locker. Only a police player whose grade the framework counts as boss can use it.

Arguments

  • lockernumber— The evidence locker id.
/convertinventory <kind>server console or command.convertinventory ACE

Convert old ESX inventories into ox_inventory's format, as ox_inventory's command of the same name does. Back up the database first.

Arguments

  • kindstring— 'esx' (player inventories in the old ESX format), 'esxproperty' (ESX property storage) or 'linden' (trunks and gloveboxes from linden_inventory).
/clearActiveIdentifier <identifier>server console

Free a character that is stuck as already active: saves its inventory and kicks the player holding it.

Arguments

  • identifierstring— The character identifier.

nxinv

nxinv adds inventory tools of its own. It runs in the server console, or in game for a player with the command.nxinv ACE. nxinv help lists the subcommands.

/nxinv status [detail]console or command.nxinv

Whether the inventory is active and why not when it is off, the framework and its bridge, player and drop sizes, and which ox_inventory dependants have attached.

Arguments

  • detail?string— 'exports', 'events' or 'all' for the long version.
/nxinv bridgeconsole or command.nxinv

The selected framework bridge, whether it is attached, the framework's version, and the bridges installed.

/nxinv saveconsole or command.nxinv

Write every changed inventory to the database now, like saveinv but without closing anything.

/nxinv exploitsconsole or command.nxinv

Per-player counts of refused, suspicious requests this session.

/nxinv orphans [restore] [limit]console or command.nxinv

Items set aside because data/items.lua no longer defines them (NxInventory.orphans). Add the item back to data/items.lua, restart, then restore.

Arguments

  • restore?string— 'restore' puts back every orphan whose item exists again.
  • limit?number— How many to list. Defaults to 50.
/nxinv trace <state>console or command.nxinv

Log every ox_inventory call by the resource that made it. Useful to find which script misbehaves.

Arguments

  • statestring— 'on' or 'off'.
/nxinv migrate [action] [from=<path>] [to=<path>] [scan=<path>] [all] [force] [dry]server console

Move a server from ox_inventory to nx_hud. check prints a preflight table and ends with PREFLIGHT: GO or NO-GO, and writes nothing. apply copies your data files into nx_hud/data/ and the images your items use into nx_hud/web/images/, then validates what it wrote. esx-items writes the ESX items table's extra rows into data/items.lua. It reads the old folder and never changes it.

Arguments

  • action?string— 'check' (the default), 'apply', 'esx-items' or 'help'.
  • from=<path>?string— The full path of your old ox_inventory folder. Without it, the installed ox_inventory resource is read.
  • to=<path>?string— apply: write into this folder instead of nx_hud.
  • scan=<path>?string— check: scan every resource under this folder instead of the started ones.
  • all?flag— apply: copy every image, also the ones no item uses.
  • force?flag— apply: copy images even when NxInventory.fileBudget says no.
  • dry?flag— apply and esx-items: show the plan and write nothing.
nxinv migrate check from=C:/txData/server/resources/[ox]/ox_inventory
nxinv migrate apply from=C:/txData/server/resources/[ox]/ox_inventory

nxtarget

/nxtarget status [detail]console or command.nxtarget

Whether targeting is active and why not when it is off, and how many options each resource has registered. In a player's F8 it prints that player's own client.

Arguments

  • detail?string— 'exports' or 'all' for the long version.
/nxtarget trace <state>console or command.nxtarget

Log every target export call by the resource that made it.

Arguments

  • statestring— 'on' or 'off'.

Zone creator

/zone <zoneType> [useLast]command.zone ACE

Draw a zone in the world, as ox_lib's zone creator does. The zone starts where you stand; the on-screen prompt lists the keys for moving, sizing, turning and placing poly points. Enter asks for a name and a format (function, array or target) and saves it. Esc cancels. Saved zones are appended to created_zones.lua in the nx_hud folder.

Arguments

  • zoneTypestring— 'box', 'sphere' or 'poly'.
  • useLast?string— Start from the size and heading of the last box or sphere you saved this session.
# server.cfg
add_ace group.admin command.zone allow
NX Docs