[RELEASE] TREW HUD UI - A lightweight HUD for ESX, VRP AND VRPEX

how can i move the items to tje bottom

2 Likes

I’m try to make 2 job. But after i use setjob2, ESX.PlayerData.job2 become nil.
I’m just duplicate function has job, and replace with job2. I try to print ESX.PlayerData.job2.label. job2 not nil until I use setJob2. But the HUD in esx_extended and database can change the job after use setJob2.
How can i fix this?

1 Like

Can anyone help how to move the icons from top left to between bottom right/center?

Did you ever figure that out ?

I’ve been trying to move it under the mini map but can’t figure it out.

his photos posted but no help visibly …

Only shows player hud after a person has died.

any one have the legacy fuel set up for vrp2

Cant get any cash to appear on the hud any ideas?

You saved so much time :blush: and headaches, thank you so much :slight_smile:

Hmmm I can’t get the player info to go down from top right. If I change bottom to top it won’t go down, even changing right to left etc doesn’t affect it. I managed to move the speedo one to the left just fine using the main.css.

.info.player { bottom: 140px; right: 25px; text-align: right;}
.info.player #job span { font-size: 24px; color: #FFF; font-weight: 900; text-transform: uppercase; 

Also I see this script also tries to block street name and other default HUD elements from showing, however for some reason street and vehicle model still show up?

I tried this in it’s own addon but doens’t affect it either.

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		HideHudComponentThisFrame(9) -- STREET NAME
		HideHudComponentThisFrame(7) -- Area NAME
		HideHudComponentThisFrame(8) -- Vehicle Class
		HideHudComponentThisFrame(6) -- Vehicle Name
	end
end)

I too see a flickering location popup on the bottom right and the ammunition flickering on the top right. Have you found a fix?

So i added the ESX to my server but for some odd reason its not showing up properly can someone help? Yes i am new to this. I legit just started a server this weekend because alot of people wanted me. Nevermind we fixed it :smiley:

Yeah I got the same too, I can’t disable the text either. I assume due to old coding and the games changed a bit.

Hey found a fix, make a new script resource in your resources folder called “hud_fix” or something you want.

Make two files and pop the below code in (note for client.lua you might want to add/remove the various options, I saved the link to the numbers so you can re-create the lines as needed.

client.lua

Citizen.CreateThread(function()
	while true do
		Citizen.Wait(0)
		HideHudComponentThisFrame(1) -- Wanted Stars
		HideHudComponentThisFrame(2) -- Weapon Icon
		HideHudComponentThisFrame(3) -- Cash
		HideHudComponentThisFrame(4) -- MP Cash
		HideHudComponentThisFrame(5) -- MP Message
		HideHudComponentThisFrame(6) -- Vehicle Name
		HideHudComponentThisFrame(7) -- Area Name
		HideHudComponentThisFrame(8) -- Vehicle Class
		HideHudComponentThisFrame(9) -- Street Name
	end
end)

-- https://docs.fivem.net/natives/?_0x6806C51AD12B83B8

__resource.lua

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

client_script 'client.lua'

Then simply add the resource name to your server.cfg (ensure hud_fix or whatever you called it)

1 Like

HUD NOT MOVING FIX:

So I spent ages changing this bit of code trying to work out why it won’t move:

.info.server = the server image
.info.player = the player hud e.g. health, stam, water, food, money, job name etc

After having a good look in the javascript I can see it checks for true/false flags for the element. I enabled the server image flag in config.lua to true and used a transparent one (https://i.imgur.com/kJbENNM.png) and then changed:

.info.player { top: 140px; right: 25px; text-align: right;}

TO:

.info.player { bottom: 22px; right: 25px; text-align: right;}

NOTE: I have my street area, voice icon and speedo in other areas so the bottom right is free to have it down there.

So I assume theres some quirk with not having a server image and then the hud being able to be moved, I don’t know enough coding to understand why that is, I assume the element part is messing with the CSS if it’s being told to add the pixel margin when flagged as false?

2 Likes

How can i enable the mini map

in config.lua

1 Like

Hi guys. i keep getting this error, anyone know how to fix it.
attempt to perform arithmetic on a nil value (seatbeltejectspeed)

Weird, sounds like an error on seat belt ejcetion on crash, I assume it occurs when you have no seatbelt on as you hit something?

Sounds like you may have broken something on the script, might pay to zip up the addon and add a fresh install of it and then try again.