[FREE RELEASE] [vRP] Inventory Hud | Hotbar & more, secure and well coded!

UPDATE v1.9.8

  • Added new marker system. Now you can customize the markers for each chest and shop type
  • Now you need to press E to open a shop or a chest
  • Fixed other html small issues

1 Like


I cant move just 1 item


and if an item is in the hot bar it can’t be moved

this will be fixed soon

and this won’t be changed for now

1 Like

could you add an animation that plays when a player opens the inventory?

Yes, I will

Hi, yes it is possible

hello bro
please check message in cfx :slight_smile:

like this one

1 Like

@justgabri I’m getting kinda an error, when I start the inventory up on a server the things people have in there trunks are gone?

no they are stored on db.

okay but when I use the trunk from your inventory there is no items in the trunk but when I use the F9/K menu’s inventory there is? @justgabri

no they save with different keys in db

okay but how can i do so it saves with the same key @justgabri

does this work for esx an is able to be used with essential mode and legacy mode

No only for vrp

@justgabri any new update?

not for now

Hey, there is this little bug that when lets say. I have 2 weapons with bullets also.
I put 1 in Slot 1 other in Slot 2. I equip slot1 weapon and load the bullets. Until now everyting is okay. IF i press Slot2 second weapon, i’ll Holster weapon from Slot1 and equip Slot2 weapon, BUT the bullets from the first weapon (Slot1) will dissapear and not store. I’ll look to fix it, but i wanted to mention it. Its a cool plugin and i’ve looked for a long time for one and I wanna help to it if i find any more problems.

2 Likes

Replace it and it should be okay
vrp_inventoryhud/client/weapon.lua

currentWeapon = nil

function vRPin.equipWeapon(weapon)
    local ped = PlayerPedId()
    local selectedWeapon = GetSelectedPedWeapon(ped)
    print(currentWeapon, weapon)
    if currentWeapon == weapon and not (selectedWeapon == GetHashKey('WEAPON_UNARMED')) then
        vRP.playAnim({true,{{"reaction@intimidation@1h","outro",1}},false})
        Citizen.Wait(1600)
        ClearPedTasks(ped)
        local currentAmmo = GetAmmoInPedWeapon(ped, GetHashKey(currentWeapon))
        RemoveWeaponFromPed(ped, GetHashKey(weapon))
        if currentAmmo > 0 then
            INserver.holstered({currentWeapon, currentAmmo})
        end
        currentWeapon = nil
        vRPin.notify({name = weapon, count = 1, label = Config.Items[weapon][1]}, "Holstered")
    else
        if currentWeapon == nil then
            RemoveAllPedWeapons(ped, true)
            currentWeapon = weapon
            vRP.playAnim({true,{{"reaction@intimidation@1h","intro",1}},false})
            Citizen.Wait(1600)
            ClearPedTasks(ped)
            GiveWeaponToPed(ped, GetHashKey(weapon), 0, false, true)
            vRPin.notify({name = weapon, count = 1, label = Config.Items[weapon][1]}, "Unholstered")
        else
            vRP.notify({"Unequip your holding weapon first"})
        end
    end
end

RegisterCommand('reload',function()
    if currentWeapon ~= nil then
        local ped = PlayerPedId()
        local magazineSize = GetMaxAmmoInClip(ped, GetHashKey(currentWeapon))
        local currentAmmo = GetAmmoInPedWeapon(ped, GetHashKey(currentWeapon))
        local toReload = magazineSize

        if currentAmmo > 0 then
            toReload = magazineSize - currentAmmo
        end

        INserver.requestReload({currentWeapon, toReload}, function(ok)
            if ok then
                SetPedAmmo(ped, currentWeapon, magazineSize)
                MakePedReload(ped)
            end
        end)
    end
end)
RegisterKeyMapping('reload', 'Reload your weapon', 'keyboard', 'R')

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(100)
        if currentWeapon ~= nil then
            local ped = PlayerPedId()
            local currentAmmo = GetAmmoInPedWeapon(ped, GetHashKey(currentWeapon))
            if currentAmmo < 1 then
                GiveWeaponToPed(ped, GetHashKey(currentWeapon), 0, false, true)
            end

            if GetSelectedPedWeapon(PlayerPedId()) == GetHashKey('WEAPON_UNARMED') then
                currentWeapon = nil
            end
-- do whatever u want with this, but this will also rremove ur bullets so if u want make a check and send remain bullets in inventory
            -- if vRP.isInComa({}) or vRP.isHandcuffed{} or vRP.isJailed({}) then
            --     currentWeapon = nil
            --     RemoveAllPedWeapons(PlayerPedId(), true)
            -- end
        else
            Citizen.Wait(1600)
        end
    end
end)
1 Like