if xPlayer.canCarryItem(items[1].item_id, tonumber(items[1].amount)) then
MySQL.Async.execute('DELETE FROM okokMarketplace_items WHERE item_id = @item_id AND id = @id', {
['@id'] = items[1].id,
['@item_id'] = items[1].item_id,
},function (rowDeleted)
if rowDeleted > 0 then
if items[1].sold then
xPlayer.addAccountMoney('bank', tonumber(items[1].price))
TriggerClientEvent('okokNotify:Alert', xPlayer.source, "MARKET", "You claimed "..items[1].price.." €", 5000, 'success')
if Webhook ~= '' then
local identifierlist = ExtractIdentifiers(xPlayer.source)
local data = {
playerid = xPlayer.source,
identifier = identifierlist.license:gsub("license2:", ""),
discord = "<@"..identifierlist.discord:gsub("discord:", "")..">",
type = "claim",
action = "Claimed an Ad",
item = items[1].label.." (x"..items[1].amount..")",
price = items[1].price,
desc = items[1].description,
title = "MARKETPLACE - Items",
}
discordWenhook(data)
end