Coder Social home page Coder Social logo

lj-hud's Introduction

LJ HUD

lj-hud used with QBCore Framework

Join my Discord laboratory for updates, support, and special early testing!
https://discord.gg/loljoshie

Remade and improved off an earlier existing qb-hud and given permission from the original developer.
Runs at ~ 0.04 to 0.09 ms if you have more optimization suggestions feel free to reach out

MAKE SURE YOU REMEMBER:

If you're using lj-fuel you need to change LegacyFuel exports to lj-fuel

  1. FULLY RESTART YOUR FIVEM CLIENT IF YOUR SERVER CRASHES OR YOU'VE LEFT THE GAME. PMA-VOICE WILL NOT GRAB YOUR PROXIMITY CORRECTLY AND WILL BREAK MY HUD IF NOT!
  2. HAVE PMA-VOICE (ONESYNC ENABLED)
  3. HAVE lj-hud ENSURED LOWER THAN ANY OF THE DEPENDENCIES LISTED ABOVE
  4. THIS DOES NOT COME WITH A COMPASS YOU CAN USE YOUR OWN OR GRAB lj-compass

My Compass

lj-compass

Dependencies

Key Features

  • Switch between square and circle map with in-game /circle or square
  • Cinematic Mode (fully hides hud)
  • Nitro when actived icon turns light red
  • When dead heath radial turns red
  • Dev mode radial when permission to do so (if you want dev mode working must follow instructions below)
  • Headset icon appears when connected to radio channel
  • Voice proximity and radio proximity highlighted
  • Radial icons realign
  • Seat belt equipped icon indicator
  • Oxygen
  • Stamina
  • Engine health orange and red icon indicator
  • Fuel low alert
  • Fuel gauge color changes
  • Harness equipped icon indicator
  • Minimap white borders

Previews

resource ms

resource ms

configurations found in lj-hud/config.lua and lj-hud/html/js/config.js

configs

circle or square map in-game

map.switch.mp4

circle or square map

map

all radial options

all circles

cinematic mode

cinematicmode

nopixel engine

np engine

new engine

new engine

oxygen

oxygen

radio headset

radio headset

active radio

radio active

nitro

nitro

active nitro

nitro active

Find qb-adminmenu / client.lua and find this part

local banlength = nil
local showCoords = false
local vehicleDevMode = false
local banreason = 'Unknown'
local kickreason = 'Unknown'

local menu = MenuV:CreateMenu(false, 'Admin Menu', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test')
local menu2 = MenuV:CreateMenu(false, 'Admin Options', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test1')
local menu4 = MenuV:CreateMenu(false, 'Online Players', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test3')
local menu5 = MenuV:CreateMenu(false, 'Manage Server', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test4')
local menu6 = MenuV:CreateMenu(false, 'Available Weather Options', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test5')
local menu7 = MenuV:CreateMenu(false, 'Dealer List', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test6')
local menu8 = MenuV:CreateMenu(false, 'Ban', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test7')
local menu9 = MenuV:CreateMenu(false, 'Kick', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test8')
local menu10 = MenuV:CreateMenu(false, 'Permissions', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test9')
local menu11 = MenuV:CreateMenu(false, 'Developer Options', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test10')
local menu12 = MenuV:CreateMenu(false, 'Vehicle Options', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test11')
local menu13 = MenuV:CreateMenu(false, 'Vehicle Categories', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test12')
local menu14 = MenuV:CreateMenu(false, 'Vehicle Models', 'topright', 220, 20, 60, 'size-125', 'none', 'menuv', 'test13')

Make a new space under then copy and paste this snippet

(you can also do /dev in-game if you have rank "admin" or higher)

local devmode = false

local menu_buttondev = menu11:AddCheckbox({
    icon = '⚫',
    label = 'Dev Mode',
    value = menu2,
    description = 'Enable/Disable Developer Mode'
})

menu_buttondev:On('change', function(item, newValue, oldValue)
    devmode = not devmode
    TriggerEvent('qb-admin:client:ToggleDevmode')
    if devmode then
        while devmode do
            Citizen.Wait(200)
            SetPlayerInvincible(PlayerId(), true)
        end
            SetPlayerInvincible(PlayerId(), false)
    end
end)

Find qb-smallresources / client / seatbelt.lua find this comment "-- Events" and replace with this snippet up to comment "-- Export"

-- Events

RegisterNetEvent('seatbelt:client:UseHarness') -- On Item Use (registered server side)
AddEventHandler('seatbelt:client:UseHarness', function(ItemData)
    local ped = PlayerPedId()
    local inveh = IsPedInAnyVehicle(ped, false)
    local class = GetVehicleClass(GetVehiclePedIsUsing(ped))
    if inveh and class ~= 8 and class ~= 13 and class ~= 14 then
        if not harnessOn then
            LocalPlayer.state:set("inv_busy", true, true)
            QBCore.Functions.Progressbar("harness_equip", "Attaching Race Harness", 5000, false, true, {
                disableMovement = false,
                disableCarMovement = false,
                disableMouse = false,
                disableCombat = true,
            }, {}, {}, {}, function()
                LocalPlayer.state:set("inv_busy", false, true)
                ToggleHarness()
                TriggerServerEvent('equip:harness', ItemData)
            end)
            harnessHp = ItemData.info.uses
            harnessData = ItemData
        else
            LocalPlayer.state:set("inv_busy", true, true)
            QBCore.Functions.Progressbar("harness_equip", "Removing Race Harness", 5000, false, true, {
                disableMovement = false,
                disableCarMovement = false,
                disableMouse = false,
                disableCombat = true,
            }, {}, {}, {}, function()
                LocalPlayer.state:set("inv_busy", false, true)
                ToggleHarness()
            end)
        end
    else
        QBCore.Functions.Notify('You\'re not in a car.', 'error')
    end
end)

-- Functions

function ToggleSeatbelt()
    if seatbeltOn then
        seatbeltOn = false
        TriggerEvent("seatbelt:client:ToggleSeatbelt")
        TriggerServerEvent("InteractSound_SV:PlayOnSource", "carunbuckle", 0.25)
        TriggerEvent('QBCore:Notify', "Seat belt unbuckled!", "error")
    else
        seatbeltOn = true
        TriggerEvent("seatbelt:client:ToggleSeatbelt")
        TriggerServerEvent("InteractSound_SV:PlayOnSource", "carbuckle", 0.25)
        TriggerEvent('QBCore:Notify', "Seat belt buckled!")
        
    end
end

function ToggleHarness()
    if harnessOn then
        harnessOn = false
        TriggerEvent("seatbelt:client:ToggleHarness")
        TriggerEvent('QBCore:Notify', "Race harness off!", "error")
    else
        harnessOn = true
        TriggerEvent("seatbelt:client:ToggleHarness")
        TriggerEvent('QBCore:Notify', "Race harness on!")
    end
end

function ResetHandBrake()
    if handbrake > 0 then
        handbrake = handbrake - 1
    end
end

-- Export

Installation

  • Download lj-hud put it anywhere in the [resources] directory.
  • Add the following code to your server.cfg
ensure lj-hud 

Change Logs

3.1

  • Added in-game command to switch between circle or square map
  • Fix outline border not syncing with change of map
  • Added highlight background for microphone and radio when active
  • Replace water icon
  • Changed some colors
  • More optimization

3.0

  • Added "Dynamic" show status feature
  • Added new javascript .config
  • Added colored maps rather than GTA defaults
  • Added option to switch between newer or older versions of QBCore
  • Added when dead health color changes
  • Added oxygen when underwater
  • Added stamina when sprinting or running
  • Added nitro active color
  • Added more configuration
  • Added new engine
  • Added speed values
  • Added bank command
  • Cleaned all files and added more informational context
  • More optimization

2.0

  • Added radio highlight color
  • Added radio icon when connected to channel
  • Added dev mode used either from admin menu or in-game command
  • Fixed nitrous radial showing without being installed
  • More optimization

1.0

  • Initial release

Future Updates

  • In-game menu
  • Cooldown radial option for minigames
  • Battery radial option for radio
  • More optimization shit

Issues and Suggestions

Please use the GitHub issues system to report issues or make suggestions, when making suggestion, please keep [Suggestion] in the title to make it clear that it is a suggestion.

lj-hud's People

Contributors

loljoshie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.