@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.
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.
[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
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
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)
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.
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.
SCRIPT ERROR: @esx_inventoryhud/server/main.lua:312: attempt to compare number with nil
SCRIPT ERROR: @esx_inventoryhud_trunk/server/esx_trunk-sv.lua:153: attempt to compare number with nil