Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make useitem fn fit qb-core changes #519

Merged
merged 8 commits into from
Nov 13, 2024
6 changes: 3 additions & 3 deletions server/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,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
Loading