[Release][ESX][Free] Cosmo HUD and Speedometer

Awsome work dude, also trying to find where i can change the colors of each.
Anyone can help point me in some directions ? Thanks

(EDIT) FIXED !

Mumble please

Anybody here managed to still display the waypoint distance (km/miles) below the map?

Since using this minimap, it won’t display whatsoever.

Remove Line 130, 131 from client.lua

BeginScaleformMovieMethod(minimap, ‘HIDE_SATNAV’)
EndScaleformMovieMethod(

Voice Indicator addon

In html file add

        <div id="VoiceIndicator" class="BaseCircle">
            <i id="VoiceIcon" class="fas fa-microphone"></i>
        </div>

In Your css file add

        .fa-microphone {
        color: white;
        position: absolute;
        font-size: 1.6vh;
        left: 1.5vh;
        bottom: 1.2vh;
        }

Aswell in you javascript file add

        if (data.action == "voice_level") {
                if (data.voicelevel == 1) {
                    data.voicelevel = 33
                } else if (data.voicelevel == 2) {
                    data.voicelevel = 66
                } else if (data.voicelevel == 3) {
                    data.voicelevel = 100
                }
                VoiceIndicator.animate(data.voicelevel / 100);
        }

Also Add

        VoiceIndicator = new ProgressBar.Circle("#VoiceIndicator", {
         color: "white",
        trailColor: "grey",
        strokeWidth: 12,
        trailWidth: 12,
        duration: 250,
        easing: "easeInOut",
        });

At the very top of the file under

        $(document).ready(function() {

After that go to you client.lua file and add

        function Voicelevel(val)
            SendNUIMessage({
                action = "voice_level",
                voicelevel = val 
            })
        end
        exports('Voicelevel', Voicelevel)

After that you can navigate to /mumble-voip/client.lua:76 and add

        exports['cosmo_hud']:Voicelevel(2) -- To make normal the default when initializing

After that is done Go to /mumble-voip/client.lua:802 and add

        exports['cosmo_hud']:Voicelevel(voiceMode)

Under playerData.mode = voiceMode

After you have done that you should be good

1 Like

And if you want to add an indicator when talking navigate to /mumble-voip/client.lua:895

    		if playerTalking then
			exports['cosmo_hud']:VoiceTalking(true)
		else
			exports['cosmo_hud']:VoiceTalking(false)
		end

Under the SendNUIMessage

And inside of cosmo_hud/client.lua

Add

		function VoiceTalking(bool)
		  SendNUIMessage({
		  action = "voice_talking",
		  talking = bool 
		  })
		end
		exports('VoiceTalking', VoiceTalking)

After that is done open cosmo_hud/html/script.js

	if (data.action == "voice_talking") {
			if (data.talking) {
					VoiceIndicator.path.setAttribute("stroke", "yellow");
			} else if (!data.talking) {
					VoiceIndicator.path.setAttribute("stroke", "white");
			}
	}

If you run into any issues let me know

1 Like

works perfectly, tysm!

Is there away to add fuel level?

Pushed an update with fuel and speaking indicators to GitHub.

Thanks to @AAspect for providing much of the code.

The Fuel indicator doesnt go all the way up? anyone got a fix for this?

Oversight on my part, should work ok now.

Any chance of letting us use legacy fuel instead of frfuel … ?!

im having the same issue is there any fix yet?

1 Like

Maybe in localhost it can have this problem. But on a box I had no problem

Wondering if this was just a me thing? Anyone else have a black outline around the circles?

1 Like

is there a way to remove the voice indicator? since mumble is broken

Really enjoying this HUD, thank you Cosmo.

I too have the big radar issue mentioned by @BrianChannel that i’ve not been able to solve yet, but other than that, this HUD is terrific.

To those with flickering Maps or other flickering this elements, I’ve found before this is often when two (or more) resources are trying to load the same thing. Two resources trying to load maps / two resources trying to load ammo (if ammo is flashing) for example. Hope that helps.

Thanks again Cosmo i’ll be keeping an eye on development.

1 Like

If anyone wants the fuel level to use LegacyFuel, go to cosmo_hud/client.lua:151 and replace

local fuellevel = GetVehicleFuelLevel(veh)

with

local fuellevel = exports["LegacyFuel"]:GetFuel(veh)
5 Likes

Same issue, probably something wrong with library.

What resolution are you using?