qbcore-framework/qb-shops

[BUG] Shop inventory is persistent between players

bandgeekndb opened this issue · 1 comments

I'm unsure if this is the desired behavior or a bug, but shop inventory seems to synchronize across players causing items to go out of stock for players if all the inventory is bought.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a configured shop
  2. Buy items
  3. Have someone else use the shop
  4. They will see the items with the reduced quantities based on what you bought

Expected behavior
I would have assumed the stock was client-based and independent for each player, but that's why I wanted to ask if this was a bug or intended behavior. It seems the shop quantities are synced inconsistently. A newly logging in player will see the shop at full stock, but then after a minute, the shop stock will show the same as mine with reduced item quantities. We can't reliably determine when shop stocks are reset besides through the qb-truckerjob resource delivering boxes.

Questions (please complete the following information):

  • When you last updated: Fresh copy from Github today
  • Are you using custom resource? which ones? lj-inventory
  • Have you renamed qb- to something custom? No

Most of this is intended behavior. There is no mechanism to restock the shops otherwise. Encouraging use of the trucking job is a huge key to keeping the shops stocked.

Otherwise, you would have to write a function to TriggerServerEvent("qb-shops:server:RestockShopItems", CurrentLocation.store). It would need to loop through the available shops to add stock.