Skip to content

Commit

Permalink
fix: purchase larger amount than stocked
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtyMan committed Nov 24, 2024
1 parent 05bac43 commit 474e7b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,12 @@ QBCore.Functions.CreateCallback('qb-inventory:server:attemptPurchase', function(
end
end

if amount > itemInfo.amount then
TriggerClientEvent('QBCore:Notify', source, 'Cannot purchase larger quantity than currently in stock', 'error')
cb(false)
return
end

if not CanAddItem(source, itemInfo.name, amount) then
TriggerClientEvent('QBCore:Notify', source, 'Cannot hold item', 'error')
cb(false)
Expand Down

0 comments on commit 474e7b4

Please sign in to comment.