[ADDON][ESX] HUD Toggle Hotkey - Disable Your HUD

- - ESX HUD Toggle Script Addon - -

This small addon to the es_extended resource allows you to toggle the HUD displayed automatically by es_extended.

How Does It Work?

The default hotkey to toggle the HUD is F9, however this can be changed to suit your control layout.
HUD Toggled ON:
hudon
HUD Toggled OFF:
hudoff

How Do I Install?
There are 2 options to installing this script addon, either copy the code below and place it in yourself OR download the github of my version of es_extended and replace your one.

1st Option:
Copy this code and place it in es_extended\client\main.lua at the line 418 mark just after this:
code

^^ It does NOT have to be placed exactly after this, however it is nice to have next to this as they both toggle the HUD in given circumstances.


-- Toggle HUD Hotkey

Toggle=true

if Config.EnableHud then
        Citizen.CreateThread(function()
	        while true do
		        Citizen.Wait(1)
		        if IsControlJustPressed(0, Keys['F9']) and Toggle == true then
			        Toggle = false
			        TriggerEvent('es:setMoneyDisplay', 0.0)
			        ESX.UI.HUD.SetDisplay(0.0)
		        elseif IsControlJustPressed(0, Keys['F9']) and Toggle == false then
			        Toggle = true
			        TriggerEvent('es:setMoneyDisplay', 1.0)
			        ESX.UI.HUD.SetDisplay(1.0)
		        end
	        end
        end)
end

2nd Option:
Download my version of ex_extended and replace your version with this new one, once you have done so, you should be good to go if you do not wish to change anything. This is recommended for beginners who are not so good at coding:

I am also working on getting this addon script to work with other ESX resources, so it toggles all HUD’s from all resources, tell me which resources you would like me to create HUD toggles for next! :smiley:

Permission from ESX creator to release script addon:

7 Likes

This already is a script. Lol

1 Like

Why even make it in the es_extended resource and not an own resource?, theres already a better one I recommend for hiding the hud

2 Likes

Oh, I had been searching for a HUD toggle for quite a while, but I had not seen any. Thanks for alerting me though :smiley:

Not working on latest version of es_Extended,
and broking all about “esx”.

1 Like

how can i add the out of bank money shown in the screenshot?

1 Like

how can I do to get a command in which I type /info and they appear and then disappear in a time?

Did you have any luck?

Change the line that toggles the HUD when the keys are pressed with a register command “help”
Also you can use citizen.wait to make it disappear after time

Do you know how to make disappear using citizen.wait? I do not know how to use it haha

some way that the script stays activated when the server is turned on
I mean that it is activated by default when you start the game and to show it again, put F10

Yeah, just reverse these lines:
TriggerEvent(‘es:setMoneyDisplay’, 0.0)
ESX.UI.HUD.SetDisplay(0.0)
with
TriggerEvent(‘es:setMoneyDisplay’, 1.0)
ESX.UI.HUD.SetDisplay(1.0)
also set Toggle to be false and switch them in the loop.

cash not see not work
bank yes work
black money work
name work

1 Like

Where can I get that HUD from?

Is there also a /hudon /hudoff as well? Or strictly keybind?

just register a command and paste the code in said command.

on new update doesnt show money of wallet

2 Likes

sorry to revive an old topic but which lines? the one with the keybind or one with the pause menu?

It really works, but what if you need the standard hud to be permanently turned off?