Hiding GTA HUD components in FiveM: every component ID and how to use them
The vanilla GTA HUD was designed for a single-player action game: area names that slide in when you cross a district, a vehicle name in the corner when you enter a car, cash counters, an aiming reticle, weapon stats on the wheel. Most roleplay servers replace much of it with their own HUD, and almost all of them do it with the same native, HideHudComponentThisFrame, and a list of magic numbers. This page is the reference for those numbers, a sensible default set for roleplay servers, the sniper-scope exception most scripts get wrong, and the natives for moving components rather than hiding them.
Short answer: HideHudComponentThisFrame(id) hides one HUD component for the current frame, so it runs in a Wait(0) loop. The useful IDs are 1 wanted stars, 2 weapon icon, 3 cash, 4 MP cash, 6 vehicle name, 7 area name, 8 vehicle class, 9 street name, 13 cash change, 14 reticle and 20 weapon wheel stats. The minimap itself is controlled with DisplayRadar, not component IDs. Components can be moved with SetHudComponentPosition and restored with ResetHudComponentValues.

#Every HUD component ID
| ID | Component | Hide it on RP? |
|---|---|---|
| 1 | WANTED_STARS | Yes, if wanted levels are disabled |
| 2 | WEAPON_ICON | Usually |
| 3 | CASH | Yes, if your HUD shows money |
| 4 | MP_CASH | Yes |
| 5 | MP_MESSAGE | Rarely |
| 6 | VEHICLE_NAME | Usually |
| 7 | AREA_NAME | If your HUD shows the zone |
| 8 | VEHICLE_CLASS | Usually |
| 9 | STREET_NAME | If your HUD shows streets |
| 10 | HELP_TEXT | No; many scripts use it for prompts |
| 11 | FLOATING_HELP_TEXT_1 | No |
| 12 | FLOATING_HELP_TEXT_2 | No |
| 13 | CASH_CHANGE | Yes |
| 14 | RETICLE | Often, with a sniper exception |
| 15 | SUBTITLE_TEXT | No |
| 16 | RADIO_STATIONS | Only if you have a custom radio UI |
| 17 | SAVING_GAME | Yes, harmless |
| 18 | GAME_STREAM | Rarely |
| 19 | WEAPON_WHEEL | No, unless you replace the wheel |
| 20 | WEAPON_WHEEL_STATS | Yes, on most servers |
| 21 | HUD_COMPONENTS | No |
| 22 | HUD_WEAPONS | No |
IDs for HideHudComponentThisFrame and ShowHudComponentThisFrame
The same IDs work with ShowHudComponentThisFrame, which forces a component to show for a frame, and IsHudComponentActive, which tells you whether it is currently displayed. Rockstar's own enum starts at 0 for the HUD as a whole; the individual components are 1 to 20.
#A sensible roleplay default
local HIDE = { 1, 2, 3, 4, 6, 7, 8, 9, 13, 17, 20 }
CreateThread(function()
while true do
for i = 1, #HIDE do
HideHudComponentThisFrame(HIDE[i])
end
Wait(0)
end
end)This is one of the few places where a permanent Wait(0) loop is correct: the native only lasts one frame, and eleven native calls per frame are negligible. What is not fine is five different resources each running their own copy of this loop with slightly different lists, which happens easily when every downloaded HUD, speedometer and street-label script brings its own. Pick one resource to own component hiding, remove the loops from the others, and keep the list in that resource's config.
#Hiding the reticle without breaking snipers
Removing the white aiming dot (component 14) is popular on serious roleplay servers because it makes gunfights less arcade-like. Done naively, it also hides the scope overlay's aiming point on sniper rifles, which then become unusable. Exempt sniper-class weapons:
local SNIPER_GROUP = 3082541095
CreateThread(function()
while true do
local sleep = 250
local ped = PlayerPedId()
if IsPlayerFreeAiming(PlayerId()) then
sleep = 0
local weapon = GetSelectedPedWeapon(ped)
local group = GetWeapontypeGroup(weapon) & 0xFFFFFFFF
if group ~= SNIPER_GROUP then
HideHudComponentThisFrame(14)
end
end
Wait(sleep)
end
end)3082541095 is the joaat hash of GROUP_SNIPER. Masking with 0xFFFFFFFF normalises the value whether the runtime hands it back signed or unsigned. The loop only runs per frame while the player is aiming, so it costs nothing the rest of the time.
#Related HUD natives
| Native | Effect | Per frame? |
|---|---|---|
DisplayHud(false) | Hides the whole HUD until turned back on | No |
DisplayRadar(false) | Hides the minimap | No |
HideHudAndRadarThisFrame() | Hides HUD and radar for one frame; also blocks the weapon wheel | Yes |
DisplayAmmoThisFrame(false) | Hides the ammo counter | Yes |
DisplayCash(false) | Stops the cash display rendering | No |
DisplayAreaName(false) | Turns off the area name | No |
HideAreaAndVehicleNameThisFrame() | Hides area and vehicle names together | Yes |
HideHelpTextThisFrame() | Hides the help text box | Yes |
ThefeedHideThisFrame() | Hides feed notifications above the map | Yes |
HideHudAndRadarThisFrame is the right tool for cinematic moments such as a character creator camera or a cutscene. It is the wrong tool for general HUD cleanup, because it also prevents the weapon wheel from opening, which players notice immediately.
#Moving components instead of hiding them
Sometimes a component is useful but in the wrong place, typically because a custom HUD occupies the corner where GTA draws it. SetHudComponentPosition(id, x, y) moves it using screen fractions, and ResetHudComponentValues(id) restores the default. GetHudComponentPosition(id) returns the current position, which is handy for nudging from the default rather than guessing absolute numbers. FiveM adds SetHudComponentSize(id, x, y) for resizing.
local HELP_TEXT = 10
CreateThread(function()
local pos = GetHudComponentPosition(HELP_TEXT)
SetHudComponentPosition(HELP_TEXT, pos.x, pos.y + 0.05)
end)
AddEventHandler('onResourceStop', function(name)
if name == GetCurrentResourceName() then
ResetHudComponentValues(HELP_TEXT)
end
end)Component positions come from frontend.xml and are relative to the safe zone, so test at two resolutions and two safe-zone settings before shipping a layout. The minimap has its own positioning system, covered in minimap position and HUD anchors.
#Replacing street and area names with your own
Hiding components 7 and 9 only makes sense if players still get the information somewhere. Most roleplay HUDs show the current street, the crossing street and the zone name next to the minimap. The data comes from three natives, and the one rule is to fetch it on a timer rather than every frame, because the text rarely changes and the path-finding lookup is not free.
local current = { street = '', crossing = '', zone = '' }
CreateThread(function()
while true do
local pos = GetEntityCoords(PlayerPedId())
local streetHash, crossingHash = GetStreetNameAtCoord(pos.x, pos.y, pos.z)
current.street = GetStreetNameFromHashKey(streetHash)
current.crossing = crossingHash ~= 0 and GetStreetNameFromHashKey(crossingHash) or ''
current.zone = GetLabelText(GetNameOfZone(pos.x, pos.y, pos.z))
Wait(500)
end
end)GetNameOfZone returns a short code such as LEGSQU, and GetLabelText turns it into the display name, "Legion Square". A full table of those codes is in GTA 5 zone names. Send the result to your NUI only when it changes; pushing an identical message to the browser every frame is one of the most common causes of a HUD resource showing high in the resource monitor.
Players who rely on postal codes rather than street names need the nearest postal in the same panel, which works the same way on a one-second timer; see nearest-postal scripts.
#The weapon wheel
Component 20 hides the stats panel (damage, fire rate, accuracy, range) that appears when you hover a weapon on the wheel. Most roleplay servers hide it because the numbers mean nothing with modified weapon damage and they clutter the screen. Component 19 hides the wheel itself, which only makes sense if you have replaced weapon selection entirely, for example with an inventory hotbar.
Two related requests are not HUD components at all. The radio station list is component 16, but hiding it only hides the list, not the radio; a server without car radios should disable the radio wheel control instead. And the most common weapon-wheel request on roleplay servers, stopping players from cycling weapons with the mouse wheel, is a control problem solved with DisableControlAction, not a HUD one.
The wheel's look is a separate matter from what is hidden. Its background textures can be restyled with a streamed texture replacement, which is what custom weapon wheels do; that combines cleanly with hiding component 20, since the stats panel is drawn separately from the wheel art.
#Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| Component flickers | Hide loop uses Wait(1) or longer | Wait(0) while hiding |
| Street name still appears occasionally | Another resource calls ShowHudComponentThisFrame(9) | Search resources for ShowHudComponentThisFrame |
| Weapon wheel will not open | HideHudAndRadarThisFrame running constantly | Use component hides instead |
| Sniper scope has no aim point | Reticle hidden for all weapons | Exempt GROUP_SNIPER |
| Health bars under the map still visible | They are not a HUD component | Use the minimap scaleform |
| Cash still shows after payday | Only 3 hidden, not 4 and 13 | Hide 3, 4 and 13 together |
For performance, the entire hide loop is cheap. If the resource monitor shows your HUD resource high, the cost is almost always elsewhere: NUI messages sent every frame, street name lookups every frame, or ped and vehicle queries that could run every 200 ms. Throttle those, not the component hides.
Questions
How do I hide the street name in FiveM?
HideHudComponentThisFrame(9) every frame, and HideHudComponentThisFrame(7) for the area name.What is HUD component 14?
HideHudComponentThisFrame(14), but exempt sniper rifles so scopes still work.How do I hide weapon stats on the weapon wheel?
WEAPON_WHEEL_STATS, every frame.Why do I need to call it every frame?
Wait(0).How do I hide the ammo counter?
DisplayAmmoThisFrame(false) every frame. Hiding the weapon icon, component 2, does not remove the ammo count on its own.Can I hide the minimap with a component ID?
DisplayRadar(false), not with HUD component IDs.Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read