Skip to content

Commit 377be96

Browse files
authored
Merge pull request #519 from Z3rio/usable-item-improvement
fix: make useitem fn fit qb-core changes
2 parents 9afdc87 + 8a9ec6c commit 377be96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/functions.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ exports('SetItemData', SetItemData)
162162

163163
function UseItem(itemName, ...)
164164
local itemData = QBCore.Functions.CanUseItem(itemName)
165-
local callback = type(itemData) == 'table' and (rawget(itemData, '__cfx_functionReference') and itemData or itemData.cb or itemData.callback) or type(itemData) == 'function' and itemData
166-
if not callback then return end
167-
callback(...)
165+
if type(itemData) == "table" and itemData.func then
166+
itemData.func(...)
167+
end
168168
end
169169

170170
exports('UseItem', UseItem)

0 commit comments

Comments
 (0)