Esx_inventoryhud_shopse

Hello, how to set esx_inventoryhud_shops price?

Short Answer:
In the items table of your database, most likely.

Long Answer:
There are a few different versions, so there are 2 spots to check to see what applies to you.

First check the config file for any items table, such as Config.Items. Got one there listing all items and prices? Then that’s where.

But most likely it’s the version that most others use, in which case it’s done in the database. Specifically the items table of your database. You will have a column/field called “price” or “cost” or something. I am at work so can’t check the field name. But simply adjust prices there.

If you don’t have a field for prices in this table, then the esx_inventoryhud_shops script would either be broken completely, or show everything as free. If this is the case, then run this query on your database;

ALTER TABLE items
ADD price int(10);

But pretty confident that you will have a prices field and so you just need to adjust the numbers to you liking.

If this response helped, please mark it as a solution so that others can benefit too. Thanks!

Hello, i think this wil not work, maybe you could look at:GitHub - ONyambura/esx_inventoryhud_shops_2.0: esx_inventoryhud with shops included and ES localization, updated and bugs fixed

It WILL work. Even in the link you sent me, it proves it will work.

It gets the data from the items table in the database. Open your database, go to the items table, adjust the prices. Easy. No prices column? Add it with the SQL query I provided. What’s the problem?

thanks

Also, can i do the price config like in:

Yes you can. I strongly suggest you learn to code if you want to continue with whatever you are doing. There is no point being a server owner if you are not a developer. I have never understood that…

Lua is one of the easiest languages out there. Give it a shot!

Yes im trying to, but i cant find code from there that gives config option price:

Look at the code. It shows you. With a simple search in the repo for “price”.

It is looping through the table in the config file and setting the data from the database, but the price from the config. The only difference between the two scripts you linked, is that one already has the price in the table it’s looping so it uses that, and the other gets everything from the database, including price.

So to make yours like that one, all you are doing is finding;
price = itemInformation[itemResult[i].name].price,
And making it;
price = v.price,

And this is done in the server/main.lua file, as shown below.

But not just for shoptype == "regular" but for all of them, such as shoptype == "weaponshop", etc.

Then you go into the config and change the listed items from;
{name = 'water'},
And make it;
{name = 'water' , price = 5},

And do this for all the items for every shop.

Then you are done. Short of actually doing the entire script for you, you are good to go. I have given step by step instructions on what to do to adjust your prices, like you originally asked. Then showed step by step instructions on converting it from using database prices to config file prices, like you asked afterwards. So you are all set. Give it a shot!

1 Like

Thanks

If you still on help me idk if can, im trying to add new shop but all inventory displays but the shop inventory is empty, i found where is the issue OpenShopInv(“ilegal”) does not work, others inv works like regular shop, but i cant fix bc the console does not give error

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.