[Deprecated] [ESX] Disc-InventoryHUD

I’m still getting the same error I had before

Please, watch some toturials. such problems can fix very easy. i can’t believe it …

I actually fixed it by removing items, but then as soon as I added weapons to be used by inventory, it broke it again.

Thats because you didnt add the weapons into the items database.

It should look like this for weapons -> https://gyazo.com/c018efa7c7620194fde197c8cb9c112e

And like this for ammo (you need disc-ammo) https://gyazo.com/93217602c17e1263aaace2e194dff005

1 Like

image
I have it though for both

config:

One thing left to do. Add the weapons one by one. Or 5 at the time to find out which weapon causes the problem.

Ow and change -10 for max ammo. That will cause problems.

@DiscworldZA

Hi just had a look at your script, very nicely done!
I noticed that you noted that adding ammo to a weapon wasn’t working yet, but you do have most of the code there.
So i decided to checkout to see what was going wrong.
What i found was you weren’t checking weapon hashes right. Not a problem, here is how i fixed that.

client/main.lua line 26 - 31
Your code:

        for _, v in pairs(ammo.weapons) do
            if currentWeapon == v then
                weapon = v
                break
            end
        end

My changes:

        for _, v in pairs(ammo.weapons) do
            if currentWeapon == GetHashKey(v) then
                weapon = GetHashKey(v)
                break
            end
        end

Using GetHashKey makes sure you convert for example “WEAPON_PISTOL” to a hash just like you get back from GetCurrentPedWeapon.

Hope this helps, awesome script!

ReduceTheRisk

You don’t need to use GetHashKey if you’re using compile-time Jenkin’s hashes, which in cases where you’re having static strings that you’re going to convert to a hash you should be using and he is using (as can be seen in the config where he’s defining them)

any idea why my police armory (stash) is not working i have all your file’s as stated installed and in database :confused:

because if ur using the policejob armory its not going to work with this because its giving u weapon not an item

1 Like

noo i meant the stash inside the armoury room it don’t come up the promt to press E to access it

iv’e TP’ed to cord’s on config and it still dont’t work

I do see what you’re saying, and I’d agree Jenkin’s hashes is the right way to do it. However on my friends server it didn’t seem to work as intended. Not sure why or how, but that is the way we made the script work and have the ammo items actually add ammo to the player’s gun.

And I guess in this case it doesn’t matter too much for performance, seeing this is only ran every now and then.

How can i setup the Shop into the Ammu Nations with the Gun Icon on the Map?

maybe it will help…
i redownloaded the files today (from downloading it a few days ago) and there was

    blipColour = 2,
    blipSprite = 110,

now inside the config in the stores…

oh and there is a game changer world shattering bug inside disc-ammo SQL…


:stuck_out_tongue:

when i try closing the inventory it says closing at bottom right but doesnt close help me plz

Do you have the police rank?

It seems that all the weapons I add in the config are causing the error

yeah there on and i’m chief and still don’t show

It has to look like this in the config file -> https://pastebin.com/jZPiEKaw

Or else you made a mistake in the database. Just check weapon by weapon. Or you made a typo (if you added them yourself) Of you did something wrong in the config file.