Hide ESX Hud Top Right (Detailed)

Hey, So Im looking to have a command and or a control key pressed to remove the job title as well as the money bank and dirty money at the top right currently I’ve ran into an issue where its not fully working the way as intended when I do it nothing is happening I’ve located what I believe to be the source of showing the Hud ect… if someone can assist in having this hide that would be great!

local GUI           = {}
GUI.Time            = 0
local LoadoutLoaded = false
local IsPaused      = false
local PlayerSpawned = false
local LastLoadout   = {}
local Pickups       = {}

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)

  ESX.PlayerLoaded  = true
  ESX.PlayerData    = xPlayer

  for i=1, #xPlayer.accounts, 1 do

    local accountTpl = '<div><img src="img/accounts/' .. xPlayer.accounts[i].name .. '.png"/>&nbsp;{{money}}</div>'

    ESX.UI.HUD.RegisterElement('account_' .. xPlayer.accounts[i].name, i-1, 0, accountTpl, {
      money = 0
    })

    ESX.UI.HUD.UpdateElement('account_' .. xPlayer.accounts[i].name, {
      money = xPlayer.accounts[i].money
    })

  end


  local jobTpl = '<div>{{job_label}} - {{grade_label}}</div>'

  if xPlayer.job.grade_label == '' then
    jobTpl = '<div>{{job_label}}</div>'
  end

  ESX.UI.HUD.RegisterElement('job', #xPlayer.accounts, 0, jobTpl, {
    job_label   = '',
    grade_label = ''
  })

  ESX.UI.HUD.UpdateElement('job', {
    job_label   = xPlayer.job.label,
    grade_label = xPlayer.job.grade_label
  })

end)

SOLUTION:

I don’t use esx or know lua but I checked esx real quick on the github and I find that they update their HUD in Javascript

ESX.refreshHUD = function(){

		$('#hud').html('');

		for(let i=0; i<ESX.HUDElements.length; i++){
			let html = Mustache.render(ESX.HUDElements[i].html, ESX.HUDElements[i].data);
			$('#hud').append(html);
		}

—edit----

if you look at their NUI stuff:

window.onData = (data) => {

		switch(data.action){

			case 'setHUDDisplay' : {
				ESX.setHUDDisplay(data.opacity);
				break;
}

you should be able to send a NUIMessage SetHUDDisplay to on or off whenever you want.
1 Like

Hmmm just trying to figure out here how we can go about this

Well I can’t help you with the actual coding since I don’t know lua, I only know c#.

1 Like

Well I seriously appreciate you pointing me the right direction :slight_smile:

Still having issues with this Hmm…anyone else have any luck?

Try this and let me know:

It is a part of code that I made sometimes ago. I use it with nb_menuperso but I extracted it and made it a resource.
(Please be cool since I’ve just created the github only for this and it is my first “release”)

Feel free to modify it and do whatever you want.

I have question, where i can change Hud logation?

CSS file

[20 Characters]

1 Like

Hello Lucifer, may i have more informations about the CSS app.css file ? Im trying since yesterday to put on line all the HUD and i fuckd up again i suppose ! Ty for your help

It will be in the CSS file, I haven’t done it since ESX is horrible, so just mess with some of the values.

Ok np i’ll keep working on and trying, thx a lot for your help :frowning:

Hi, @Caesar, could you tell me what to change, so it’s hidden natively from the start of the client? I am bit lost in here and every try messed up the script :slight_smile:

Edit.: SOLVED by changing line 25

“local interface = true” to false

Exactly! Sorry I couldn’t reply earlier :slightly_frowning_face:

Thx For this, but i only want to hide bank money, not dirty money, how can i do that?

@Caesar I’ve been attempting to make the additions and changes indicated in your release on github, but each time I get onto the server after having made the changes, it doesn’t work. Upon troubleshooting, I realized that the files are reverting back to their local original files of both main.lua and client.lua somewhere between disconnecting from filezillla and connecting to the server. Any tips on trying to make the changes stick?

Is there a way to hide the health and armor bar aswell?

What file did you make this change in?

my problem is i change line 25 to false but it still shows the hud when I press f10 it will still toggle as well

Hello, im looking to hide ONLY money and bank account money. But i wanna keep Job and job grade, how can i do that? Been looking all day