# Giving weapons proper display names

> Fix NULL weapon names in FiveM: the HumanNameHash field in weapons.meta, registering labels with AddTextEntry, component LocName and GetLabelText.

Source: https://fam-tools.com/guides/fivem-weapon-display-names-addtextentry · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 7 min

**Short answer.** `weapons.meta` names the weapon with `<HumanNameHash>` — a text key such as `WT_PISTOL`. For add-ons, choose a new key (for example `WT_MYPISTOL`) and register its text on the client with `AddTextEntry('WT_MYPISTOL', 'My Pistol')`. Components work the same with `<LocName>`. Read any label with `GetLabelText`. Inventories like ox_inventory show their own `label`, so set both.

## Key points

- `HumanNameHash` = text key, not the name itself.
- `AddTextEntry(key, text)` on the client registers it.
- Components: `LocName` / `LocDesc` keys.
- `GetLabelText(key)` returns the text (or `NULL`).
- Inventory labels are separate from game labels.

An add-on weapon that shows “NULL” or an empty name in the weapon wheel is missing one small piece: a text label. GTA stores display names as text keys, and FiveM lets you register new keys from a script with a single native.

## The label in weapons.meta

*weapons.meta — excerpt*

```xml
<Name>WEAPON_MYPISTOL</Name>
<Model>w_pi_mypistol</Model>
<HumanNameHash>WT_MYPISTOL</HumanNameHash>
```

## Registering the text

*client.lua*

```lua
CreateThread(function()
    AddTextEntry('WT_MYPISTOL', 'Glock 17')
    AddTextEntry('WCT_MYPISTOL_CLIP1', 'Standard Magazine')
    AddTextEntry('WCT_MYPISTOL_CLIP2', 'Extended Magazine')
end)
```

Run it in any client script of the weapon resource. The weapon wheel and other game UI now show the name. `GetLabelText('WT_MYPISTOL')` returns `Glock 17`; unknown keys return `NULL`.

## Component names

*weaponcomponents.meta — excerpt*

```xml
<Name>COMPONENT_MYPISTOL_CLIP_02</Name>
<LocName>WCT_MYPISTOL_CLIP2</LocName>
<LocDesc>WCD_MYPISTOL_CLIP2</LocDesc>
```

## Inventory labels

ox_inventory, qb-inventory and ESX show their own labels from their item/weapon definitions — the game label does not change them. Set the same name in both places so the inventory and the weapon wheel agree. See [ox_inventory items](https://fam-tools.com/guides/ox-inventory-items-lua) and [ox_inventory weapon setup](https://fam-tools.com/guides/ox-inventory-weapon-setup).

## Questions

### Why does my add-on weapon show NULL?

Its `HumanNameHash` key has no text. Register it with `AddTextEntry` on the client.

### Where do I put AddTextEntry?

In a client script, for example in the weapon resource itself.

### How do I get a weapon’s display name in Lua?

`GetLabelText('WT_PISTOL')` for the key from `HumanNameHash`.

### Does AddTextEntry change the inventory name?

No. Inventories use their own `label` fields.

## Related

- https://fam-tools.com/guides/fivem-weapons-meta-explained
- https://fam-tools.com/guides/fivem-joaat-weapon-hashes
- https://fam-tools.com/guides/ox-inventory-weapon-setup
- https://fam-tools.com/guides/add-custom-weapons-to-fivem
