qbcore-framework / qb-mechanicjob

Mechanic Job For QB-Core
GNU General Public License v3.0
33 stars 174 forks source link

[BUG] Items in stash not being removed after fixing a vehicle #63

Closed ShomyTKD closed 1 year ago

ShomyTKD commented 1 year ago

Describe the bug When repairing a vehicle as a mechanic, you should be using the items inside mechanic's stash. However, once the vehicle is fixed, items don't get removed from the stash since the event SaveStashItems doesn't exist in qb-inventory anymore.

To Reproduce Steps to reproduce the behavior:

  1. As a mechanic, make sure first that you have enough materials in the stash.
  2. Go and attach a vehicle to the lift and fix it's body for example.
  3. Go back to your stash and you will notice that the materials used haven't been removed.

Expected behavior After fixing a vehicle, stash should update it's items.

Screenshots N/A

Questions (please complete the following information):

Additional context N/A

Matetv commented 1 year ago

server

RegisterNetEvent('qb-inventory:server:SaveStashItems', function(stashId, items)
    MySQL.Async.insert('INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items', {
        ['stash'] = stashId,
        ['items'] = json.encode(items)
    })
end)
github-actions[bot] commented 1 year ago

This issue has had 60 days of inactivity & will close within 7 days