Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
GhzGarage authored Nov 13, 2024
2 parents d9c9c86 + 19c6416 commit 8da3ffc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ exports('SetItemData', SetItemData)

function UseItem(itemName, ...)
local itemData = QBCore.Functions.CanUseItem(itemName)
local callback = type(itemData) == 'table' and (rawget(itemData, '__cfx_functionReference') and itemData or itemData.cb or itemData.callback) or type(itemData) == 'function' and itemData
if not callback then return end
callback(...)
if type(itemData) == "table" and itemData.func then
itemData.func(...)
end
end

exports('UseItem', UseItem)
Expand Down
4 changes: 2 additions & 2 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ RegisterNetEvent('qb-inventory:server:closeInventory', function(inventory)
local QBPlayer = QBCore.Functions.GetPlayer(src)
if not QBPlayer then return end
Player(source).state.inv_busy = false
if inventory:find('shop-') then return end
if inventory:find('otherplayer-') then
if inventory:find('shop%-') then return end
if inventory:find('otherplayer%-') then
local targetId = tonumber(inventory:match('otherplayer%-(.+)'))
Player(targetId).state.inv_busy = false
return
Expand Down

0 comments on commit 8da3ffc

Please sign in to comment.