[Release] SimpleCarHUD - Standalone Car HUD for Speed, Fuel, Seatbelt, Cruise, Time and Location [v1.30]

c95519f133d1da5139b41ce1c886d58ec4e78e48
How do i fix that?

Great work … very clean and informative. just 1 ask how can i lift the whole of the display up a little its just clashing with my aop text

thanks in advance

i have some problem even use car with this seatbelt.I driving in the car and try to get out from the car and unseatbelt and i cant to get out from the car.Did someone can help me?

@Whitigol, you can modify line 82 to the following and it will ignore controller inputs for seatbelt.

-- Check if seatbelt button pressed, toggle state and handle seatbelt logic
if IsControlJustReleased(0, seatbeltInput) and GetLastInputMethod(0) and vehicleClass ~= 8 then seatbeltIsOn = not seatbeltIsOn end

@Mart475, yes there is but you would need to do that yourself. I’ve seen seatbelt resources that use NUI and HTML to do a blinking indicator but I don’t want to complicate the script more than it needs to be :slight_smile:

@jimmys98z, it should be the same as before, just compare the previous version to the new one to find the same IsPedInAnyVehicle() check and move it the same way you did before.

@MidOut, that’s because it’s displaying fuel in liters I believe and most cars tank capacities are between 60-75L. If you would like fuel to always be a percentage from 0-100 then you can change line 156 to the following.

-- Update fuel
currentFuel = 100.0 * GetVehicleFuelLevel(vehicle) / GetVehicleHandlingFloat(vehicle,"CHandlingData","fPetrolTankVolume")

@k3ho, did you change the font used or is your game in a language other than English? If not then post the coordinates and I can check it out.

@EntraVenuS, at the top of the Lua file the screenPosX and screenPosY variables control where the HUD is drawn, just subtract from screenPosY until it’s above your text.

@imamulikhlas, that’s the default seatbelt behavior (IRL you have to take your seatbelt off before getting out as well :stuck_out_tongue:). If you don’t want that behavior then you can just comment out line 98 where it disables the control to exit the vehicle.

I’ll give it a try, thank you! :slight_smile:

EDIT
It works like a charm :slight_smile:.

yea i already fixed,my language is chinese so just change font to bigger.

Thanks for your help hud is in the correct position now thanks again

So far I really love this HUD as it shows everything you need to know in a really nice way. Anyways, I do have a question: How do I get the time, heading, street-name and district to stay on screen when not in a vehicle? I feel like it could be helpful when you’re on foot. I have tried screwing with the code a bit starting at line 36 and going down to about 138 but I’ve had no luck…

And yet another question that is a bit more general but I’m sure someone here knows that too: I’m trying to get my server to be as FPS friendly as possible, so could I theoretically change every Citizen.Wait(0) to about 4 instead so that everything inside that function updates every 4 frames instead of every next frame? Is it even worth it?

Update: I have tried what “jimmys98z” said he used to do in earlier versions, but I have had no luck moving any line down to said line, even after trying older versions, so the mistake must be on my end.

How to add sound on seatbelt? TriggerServerEvent(‘InteractSound_SV:PlayWithinDistance’, 0.9, ‘seaton’, 0.9)

Released VERSION_V1_30 with new options based on everyone’s feedback.

  • Speedometer uses MPH or KPH based on game settings (settings -> display -> measurement system)
  • Added option to display fuel as percentage
  • Added option to always display location and time
  • Added option to disable controller support
  • Added option to enable/disable exiting the vehicle when seatbelt is on
  • Added seatbelt sound and option to enable/disable

@Whitigol, @jimmys98z, @MidOut, @imamulikhlas, @Puntherline

3 Likes

I added a seatbelt sound and option in the latest version. If you would like to use InteractSound to play the seatbelt sound then just replace the PlaySoundFrontend() call on line 100 with your server event.

Good viewer, but I wanted the sound to be different when closing and unfastening

Great release. Thanks for sharing with us!

Only problem I’m having is that the text is overlaying the mini-map and they’re all stuck together kind of without any spaces in-between them. Nevertheless, I assume an easy fix.

Unfortunately, I’m using the FRFUEL script on my server and that doesn’t seem to work with the fuel level/percentage on this script. The fuel level remains at 100% at all times. I browsed the comments here and I’m not seeing any fixes for this? If anyone could help me with this I’d highly appreciate it. I’d really like to keep this script, but I have to get the fuel level/percentage working properly to match the fuel level bar on top of it.

  • Thanks

when seatblet off and I bounce off the seatbelt not making me die or get damage are this bug? or i can use another seatbelt

There’s a bit of an issue with the new release… Sometimes you lose the whole hud for no reason… any idea why?

Have the same problem, client console also displays the error of HANDLING DATA

Hi. Thanks for the release. Is any chance to randomise the fuel system? just make a different fuel level for different vehicle type?
Thanks

my fuel is showing 115% when its actually at 75% i am using LegacyFuel

Hi,
Firstly, thanks for the release. Simplicity at it’s finest. :+1:

I created a topic for help already, but maybe someone here might actually be able to help me! I’m wondering if anyone knows a way to DrawRect to represent the fuel. I feel this sort of goes against the purpose of this resource (which is why I made the separate post) but maybe someone knows a way to create it to listen to the Legacy Fuel resource.

I’ve tried picking apart various resources that DrawRect dynamically with info such as health and armor or other fuel scripts, but I can’t seem to understand the logic.

Any help is appreciated! :smiley:

  • Brownie

Edit: I’ve gone through all 490 comments on Legacy Fuel and the ones here for any similar mention. Additionally, searching for tuts on this topic provided limited/no results.

@dracuslayer @Solseer If you are having issues with the fuel percentage being different from Legacy Fuel:
Find this on SimpleCarHUD_cl.lua – line 152:

format(math.ceil(currentFuel))

and just replace it with

format(math.ceil(GetVehicleFuelLevel(vehicle)))

Now you can disable LegacyFuel’s hud, and use SimpleCarHUD’s without any major editing/repositioning.
I hope this helps.

2 Likes