I want to add repair kit, beer, vodka, and coffee. I have added the items in the items table and shops table in the database. However, when I purchase these items, there is no use option. How would I fix this?
You Can start by reading the Doc ? https://github.com/ESX-Org/esx-org.github.io/blob/master/_docs/es_extended/server-functions/esx.registerusableitem.md
EDIT by staff: working link: https://esx-org.github.io/es_extended/server/functions/registerusableitem/
Ok I have added the code in the server/main.lua and added vodka to the database. However I want to add a vodka bottle drinking animation and have a drunk effect on the screen. Do you know anywhere were I can find the animations names or whatever is required in the client/main.lua?
This is what I have so far:
Hey buddy, can you fine the page again? The link seems to be broken!
Where do you put the script
Did you ever get this resolved
Could you just explain? Your link does not work.
link didnt work
Kind people can suggest or give a link to a tutorial how to add more food and drinks to stores?
i think the script ,need be put in esx_extended/server/main.lua
and add the item to the items table database and shops database too
im looking at all the posts of the site for more info about that ,and i can do a full tutorial soon.
You have to go to the database and in the “shop” section
First of all go into your database;
Add the items into the ‘items’ section that you want to be available ingame.
go into your shop script. add this item into the config or client lua files. (most shop scripts have bread and water already, so look for these to find out how to add new ones. ***remember, the names must match the names you put into the database)
Then go into your inventory system HTML script and add a new image for the item you added.
then go into your inventory system resource.lua file and add the new item in there too
congratulations, you’ve added an item into your shop.
if you want to use the item
you need to register the item in a script.
in the client lua:
(change firstaidkid to the item you want to have an effect when used)
server script side:
local xPlayer = ESX.GetPlayerFromId(source) TriggerClientEvent('esx_extraitems:firstaidkit', source) xPlayer.removeInventoryItem('firstaidkit', 1)
congratulations, your item is now usable. remember that it all has to match with the name you gave it in the database.
At the moment the item based of what we’ve just walked through, wont do anything.
you can add animations, effects by adding lines of code underneath the client lua format i put in for you (above the ‘end’)
I am trying to add some items to the shops the items are already in the database, i have went to the shops and added the items there, restarted my server several times and the items will not show up in the shops not sure what is wrong any help will be appreciated ,
also I have seen from other threads about adding the items in the config or client/main.lua where bread and water are, but i do not see where any of the line of code is at for esx_shops
having issue with my item sql it doesnt match up to the markets in city even though i have everything layed out perfect in sql i try to add new market didnt work put old one back in now its fucked when i try to change a item nothing happens the items are stuck on bread and water and i cant even purchase them or change price in item sql doesnt do nothing in game
Have you added the items within the config.lua file?
Did you manage to get it to read from the data base rather than the config.lua?