Scripts/resources/[qb]/[qb_jobs]/cad-diving/sv_diving.lua
2024-12-29 21:06:22 +01:00

17 lines
721 B
Lua

QBCore = exports['qb-core']:GetCoreObject()
RegisterServerEvent("cad-diving:collected")
AddEventHandler("cad-diving:collected", function(type, item, count)
local xPlayer = QBCore.Functions.GetPlayer(source)
if xPlayer ~= nil then
if type == "normal" then
xPlayer.Functions.AddItem(item, count)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[item], "add")
elseif type == "rare" then
xPlayer.Functions.AddItem(item, count)
TriggerClientEvent('inventory:client:ItemBox', source, QBCore.Shared.Items[item], "add")
else
TriggerClientEvent("QBCore:Notify", source, "Du fangede intet")
end
end
end)