local QBCore = exports['qb-core']:GetCoreObject() QBCore.Functions.CreateCallback("miktar", function(source, cb, itemdata) local data = itemdata local src = source local Player = QBCore.Functions.GetPlayer(src) local kontrol = Player.Functions.GetItemByName(data.item) if kontrol then cb(kontrol.amount) if data.markedbills then Player.Functions.RemoveItem(data.item, kontrol.amount) local info = { worth = data.preice*kontrol.amount } Player.Functions.AddItem(Config.MarkedBillsItem, data.preice*kontrol.amount) else Player.Functions.RemoveItem(data.item, kontrol.amount) Player.Functions.AddMoney('cash', data.preice*kontrol.amount) end else cb(false) end end) RegisterNetEvent('alizadevseller:logSale') AddEventHandler('alizadevseller:logSale', function(itemLabel, count, earnings, isMarkedBills) local src = source local Player = QBCore.Functions.GetPlayer(src) local steamName = GetPlayerName(src) local playerId = Player.PlayerData.citizenid local firstName = Player.PlayerData.charinfo.firstname local lastName = Player.PlayerData.charinfo.lastname local fullName = firstName .. " " .. lastName local jobLabel = Player.PlayerData.job.label local headerMessage = string.format(Config.Locales['webhook_header'], steamName, fullName) local description = string.format( Config.Locales['webhook_description'], fullName, src, playerId, jobLabel, itemLabel, count, earnings ) if isMarkedBills then description = description .. Config.Locales['webhook_blackmoney_note'] end local fullMessage = headerMessage .. description local logData = { username = "alizadev - Çiçekçi Log", content = "", embeds = {{ title = Config.Locales['webhook_title'], description = fullMessage, color = 3447003, image = { url = Config.ImageURL }, footer = { text = "kashi - Çiçekçi Log", icon_url = 'https://cdn.discordapp.com/attachments/1437937532301217812/1438637800978124964/Cooz-PngLogoT_oyun.png?' } }} } if count > Config.webhookAlertLimit then logData.content = "@everyone" end PerformHttpRequest(Config.WebHookURL, function(statusCode, response, headers) print("Webhook status: " .. statusCode) end, 'POST', json.encode(logData), { ['Content-Type'] = 'application/json' }) end)