Inventoryhud - Shops

@RumDum You have to add the items via SQL to your items DB. Once you have done that you must add the item to which ever shop within the inventory hud file.

Example: Regular Shop

Items = {
{name = ‘bread’},
{name = ‘water’},
{name = ‘cigarette’},
{name = ‘lighter’},
{name = ‘rollingpaper’},
{name = ‘phone’},
{name = ‘sandwich’},
{name = ‘hamburger’},
{name = ‘cupcake’},
{name = ‘chips’},
{name = ‘pistachio’},
{name = ‘chocolate’},
{name = ‘cashew’},
{name = ‘cocacola’},
{name = ‘drpepper’},
{name = ‘energy’},
{name = ‘lemonade’},
{name = ‘notepad’},
{name = ‘fishbait’},
{name = ‘fishingrod’},
{name = ‘binoculars’},
{name = ‘bandage’},
{name = ‘medikit’},
{name = ‘icetea’}
}
},

once you add the items in the config file within your inventory hud file your good to go. You just need to make sure within your DB or sql file you have a spot for price as thats how you adjust the cost. If you dont have one set up it will be free to the players.

**Note if you dont have an image made for it, it will just be an empty black box with a name.

Hope this helps, if not contact me.
Thanks,
-JB

What inventory is this?!?!?

hello guys i have that error on cmd

[ERROR] [MySQL] An critical error happens on MySQL for query "SELECT * FROM shops LEFT JOIN items ON items.name = shops.item {=}": An item with the same key has already been added. Key: price   at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x0015a] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <fbc4ec45371543bfba3678ebb82caf6d>:0
  at MySQLAsync.FetchAll.ReaderAsync (MySql.Data.MySqlClient.MySqlCommand command) [0x000e9] in <d68afb0aae7f4a79b70303ba76ce60db>:0
  at MySQLAsync.Operation`1[TResult].ExecuteAsync (System.String query, System.Collections.Generic.IDictionary`2[TKey,TValue] parameters, CitizenFX.Core.CallbackDelegate callback, System.Boolean debug) [0x00169] in <d68afb0aae7f4a79b70303ba76ce60db>:0

how can fix that any one know?

Hello the inventory hud was removed have somebody 2.3 inventory? to download? thanks

How do you add the custom items like lockpicks etc? I am really excited and hope I can get this working!

I am also having an issue where I drag an item to my inventory to buy it but it doesnt buy it. Any help?

Add the item to the item DB first then add the iamge to inventoryhud’s img folder and the name to the resource.lua. Make sure it matches the DB name.
Also to you second question do you have cash in game? That is needed to buy items

Yes I have enough money to buy the items in my inventory but it doesn’t buy it

Any fixes for not being able to buy weapons, after getting a weapons license? As you can see, I’m using esx_license and database shows licenses/weapon as you can see in screenshot…


/Server/ main lua =
function GetLicenses(source)
TriggerEvent(‘esx_license:getLicenses’, source, function (licenses)
TriggerClientEvent(‘suku:GetLicenses’, source, licenses)
end)
end

/Client/ shop.lua =
if IsInWeaponShopZone(coords) then
if IsControlJustReleased(0, Keys[“E”]) then
if Licenses[‘weapon’] ~= nil then
OpenShopInv(“weaponshop”)
Citizen.Wait(2000)
else
exports[‘mythic_notify’]:DoHudText(‘error’, ‘You need a Fire Arms license before you can buy weapons’)
end
end
end
end
end
end)

1 Like

how do you change your inventory item imgs to your liking? i can not get them to work in my server
would you be willing to explain?

Using new esx with weight feuture and this happend with esx_inventoryhud when i want to buy food

SCRIPT ERROR: @esx_inventoryhud/server/main.lua:312: attempt to compare number with nil

need help dont know how to fix it

database items

INSERT INTO items (name, label, weight, rare, can_remove, limit, price) VALUES
(‘sandwich’, ‘sandwich’, 0, 0, 1, 25, 2),
(‘water’, ‘water’, 0, 0, 1, 25, 2)
;

1 Like

I’m having a problem where I can’t display the weaponshop inv.
I have the default menu off.
Weaponshop script off.
esx_shop disabled.
SQL is installed
but when I press F2 I get no gui.

I have looked back but the only answer is delete the weapons script which I did.

can someone please help.

Anyone know how to remove the dollar sign in the shop menu?

Help plz , I can’t not buy everything in my shop , buy I can’t buy GUN and Ammo
PLZ help me to fix it and thank you for your time to watch the video.

P.S. I added all item in my SQL item table

1 Like

Maybe your inventory is just too full and you can’t hold anymore

I empty my inventory and try to buy again , still can not buy everything.

when I try to buy bread and water from shop , display this error code.

SCRIPT ERROR: @esx_inventoryhud/server/main.lua:312: attempt to compare number with nil

I can get the item from /giveitem and use it , but I can’t buy form shop. And I can put some item in the vehicle trunk , but can’t take out into my inventory , then show this two error code.

  1. SCRIPT ERROR: @esx_inventoryhud/server/main.lua:312: attempt to compare number with nil

  2. SCRIPT ERROR: @esx_inventoryhud_trunk/server/esx_trunk-sv.lua:153: attempt to compare number with nil

Video for put and take from trunk :

Video for buying item :

how can i just use the inventory hud and not the shop and weapon store things

just remove shops from the client folder