[FREE] [STANDALONE] | vHud | Advanced Minimalistic HUD

vHud

Preview: Youtube [v1.0.0]
Download: GitHub Releases
Source Code: GitHub

Preview (v1.1.6)
  • Hud Mode 1

  • Hud Mode 2

  • Hud Mode 3

This is a complete re-make of the original V-Hud that was published a little bit ago, if you have any suggestions, please go ahead and let me know as i will be attempting to support this for as long as possible.

Script Information

  1. Performance: Runs at 0.00 Resmon (Client).
  2. Completely standalone meaning no other dependencies required.
  3. Settings page with advanced customization, along with multiple HUD Mode’s so each user can have a unique experience.
  4. Optional support for framework specific features.

If you would like to contribute, please go ahead and head over to the GitHub page and feel free to send a pull request.

Config

7 Likes

This is a great hud, but my problem is this, the minimap is on the screen from the second i get in to the server



You most likely just need to load the HUD after the player is loaded, i can most likely add support for this later on, but the script doesn’t touch the minimap at all.

I moved it a bit a down in the resource and now the minimap is gone at character selection, but now i got the other stuff lol. Love the hud btw though.

1 Like

Thank you, the reason it’s appearing is because QB has a specific event once the player has loaded in, and you just use that event to actually make the HUD appear after a character is selected.

This should do the trick but i haven’t tested so can’t say.

Go to vHud > client > core.lua

Replace the whole thing with:

Script = {
  settings = {},
  standalone = {},
  framework = {},
  fuelFunction = nil,
  visible = true,
  measurementSystem = 2.236936
}

ToggleNuiFrame(false)

Script.init = function()
  CreateThread(function()
    while not Script.settings do
      Wait(500)
    end

    Debug("Script.settings", json.encode(Script.settings))

    UIMessage("nui:data:cfg", Config)

    xpcall(checkFuelScripts, function(err)
      print("Error when calling the checkFuelScripts function: ", err)
    end)

    while Script.visible do
      local sleep = 1000
      local playerStats = {}
      local ped = PlayerPedId()
      local pid = PlayerId()
      playerStats.health = math.floor((GetEntityHealth(ped) - 100) / (GetEntityMaxHealth(ped) - 100) * 100)
      playerStats.armor = math.floor(GetPedArmour(ped))


      playerStats.mic = NetworkIsPlayerTalking(pid)

      UIMessage("nui:data:playerstats", playerStats)

      local isInVeh = IsPedInAnyVehicle(ped, false)

      if isInVeh then
        local currVeh = GetVehiclePedIsIn(ped, false)
        Script.currVeh = currVeh
        UIMessage("nui:state:isinveh", true)
        local vehSpeed = math.floor(GetEntitySpeed(currVeh) * Script.measurementSystem)

        local vehData = {
          speed = vehSpeed,
          rpm = GetVehicleCurrentRpm(currVeh),
          gear = GetVehicleCurrentGear(currVeh),
          fuel = tostring(math.floor(Script:FuelFunction()))
        }

        UIMessage("nui:state:vehdata", vehData)
      else
        UIMessage("nui:state:isinveh", false)
      end

      Wait(sleep)
    end
  end)
end

Script.sendData = function()
  while not PlayerId() do
    Wait(500)
  end

  SetTimeout(2000, function()
    local playerId = GetPlayerServerId(PlayerId())
    UIMessage("nui:state:scriptConfig", Config)

    UIMessage("nui:state:pid", playerId)

    TriggerServerEvent("vhud:cb")

    local hudSettings = GetResourceKvpString("hud:kvp:settings")

    if not hudSettings then
      UIMessage("nui:state:globalsettings", Config["Default Settings"])
      UIMessage("nui:state:settings", Config["Default Settings"])
      Debug("Player didn't have any saved settings, the default ones are being sent to the NUI.")
      Script.settings = Config["Default Settings"]
      return
    end

    local storedHudSettings = json.decode(hudSettings)

    Script.settings = storedHudSettings

    UIMessage("nui:state:globalsettings", storedHudSettings)
    UIMessage("nui:state:settings", storedHudSettings)

    Debug("[nui:state:globalsettings] was called, with the data storedHudSettings: ", json.encode(storedHudSettings))
  end)
end

Script.grabPlayerCount = function()
  CreateThread(function()
    while Script.visible do
      TriggerServerEvent("vhud:cb")
      Wait(60 * 1000)
    end
  end)
end

RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()
  xpcall(Script.init, function(err)
    return print("Error when calling the Script.init function:", err)
  end)
  ToggleNuiFrame(true)
end)

xpcall(Script.sendData, function(err)
  return print("Error when calling the Script.sendData function:", err)
end)

xpcall(Script.grabPlayerCount, function(err)
  return print("Error when calling the Script.GrabPlayerCount function:", err)
end)

I went ahead and edited it once again, please copy and paste the newer version.

Will do, thanks :slight_smile:

1 Like

Hello,
I tried your HUD and HUD and the ox_fuel compatibility doesn’t work, it still shows a full tank but it’s empty, is there a way to fix this? Thank you

I went ahead and released v2.0.1 to fix some bugs, and i have attempted a fix for ox_fuel, please go ahead and try it, i haven’t tested it nor have i ever used ox_fuel, so i would have to look into it some more tomorrow.

1 Like

Gasoline for ox_fuel still does not work and allegedly it sometimes did not show how much the player was driving at what speed.

Went ahead and pushed a fix for that, the fuel was never displaying correctly inside of the UI, unsure how i never noticed, but please download the newest version.

The speed is slightly delayed since it checks every second for optimization reasons.

But to make up for it, it has a slight animation lasting 1 second counting all the way from the last speed value to the new one.

Would you mind going into more detail, i haven’t experienced the same issues with the speedometer?

A player on the server wrote to me that when he starts up, it doesn’t show him the speed, but it still shows me 0, but after the update it will probably be fine, ox_fuel is already working.

If the issue with the speedometer occurs some more, please go ahead and send me a DM on discord: vipex.v

Downloaded the latest and got this

Update: After reinstalling the hud again using the right version, its like this

I have tried alot of things now, the only way for me to get this hud to work decent is to replace it with qb-hud, if i put it in resource folder and ensure it, it mixes with the standard qb hud. Tried to ensure it top, mid, bottom etc. Keep up the good work though, glad to see you working on this :slight_smile:

Sorry, but would you mind explaining exactly what the issue is, i don’t really understand.

Do you not want it to not display while in the character selection menu?

If so, then pretty soon when i get the chance i’m just making that a config option for QB and ESX.

New update released adding that feature, please go ahead and check it out: Releases · vipexv/vHud · GitHub

Yes, its mostly a personal preference but i dont like to have a hud or minimap before after i have spawned :slight_smile:

Yeah, i just released the update for it, please go to the GitHub page and make sure to download the release ready version.

I’m going to be releasing v1.1.1 immediately to fix some issues with the new features, please update, it’s going to be out within 3-4 minutes.

v1.1.1 Is out with some bug fixes for the new features.

You are so fast i cant even respond before you have done a fix :smile: