Core = nil CoreName = nil CoreReady = false Table = nil Citizen.CreateThread(function() for k, v in pairs(Cores) do if GetResourceState(v.ResourceName) == "starting" or GetResourceState(v.ResourceName) == "started" then CoreName = v.ResourceName Core = v.GetFramework() CoreReady = true if CoreName == "qb-core" or CoreName == "qbx_core" then Table = "player_vehicles" elseif CoreName == "es_extended" then Table = "owned_vehicles" end end end end) function GetPlayer(source) if CoreName == "qb-core" or CoreName == "qbx_core" then local player = Core.Functions.GetPlayer(source) return player elseif CoreName == "es_extended" then local player = Core.GetPlayerFromId(source) return player end end function Notify(source, text, length, type) if CoreName == "qb-core" or CoreName == "qbx_core" then TriggerClientEvent('QBCore:Notify', source, text, type, length) elseif CoreName == "es_extended" then local player = Core.GetPlayerFromId(source) player.showNotification(text) end end function GetPlayerMoney(src, type) if CoreName == "qb-core" or CoreName == "qbx_core" then local player = Core.Functions.GetPlayer(src) return player.PlayerData.money[type] elseif CoreName == "es_extended" then local player = Core.GetPlayerFromId(src) local acType = "bank" if type == "cash" then acType = "money" end local account = player.getAccount(acType).money return account end end function AddMoney(src, type, amount, description) if CoreName == "qb-core" or CoreName == "qbx_core" then local player = Core.Functions.GetPlayer(src) player.Functions.AddMoney(type, amount, description) elseif CoreName == "es_extended" then local player = Core.GetPlayerFromId(src) if type == "bank" then player.addAccountMoney("bank", amount, description) elseif type == "cash" then player.addMoney(amount, description) end end end function RemoveMoney(src, type, amount, description) if CoreName == "qb-core" or CoreName == "qbx_core" then local player = Core.Functions.GetPlayer(src) player.Functions.RemoveMoney(type, amount, description) elseif CoreName == "es_extended" then local player = Core.GetPlayerFromId(src) if type == "bank" then player.removeAccountMoney("bank", amount, description) elseif type == "cash" then player.removeMoney(amount, description) end end end function HasPermission(src, permissions) if CoreName == "qb-core" or CoreName == "qbx_core" then for _, perm in pairs(permissions) do if Core.Functions.HasPermission(src, perm) then return true end end return false elseif CoreName == "es_extended" then local playerGroup = Core.GetPlayerFromId(src).getGroup() for _, perm in pairs(permissions) do if perm == playerGroup then return true end end return false end end Config.ServerCallbacks = {} function CreateCallback(name, cb) Config.ServerCallbacks[name] = cb end function TriggerCallback(name, source, cb, ...) if not Config.ServerCallbacks[name] then return end Config.ServerCallbacks[name](source, cb, ...) end RegisterNetEvent('pa-vehicleshop:server:triggerCallback', function(name, ...) local src = source TriggerCallback(name, src, function(...) TriggerClientEvent('pa-vehicleshop:client:triggerCallback', src, name, ...) end, ...) end) function SendVehiclePurchaseLog(player, vehicle, price, paymentType, plate) -- Webhook URL'sinin yapılandırılmış olup olmadığını kontrol et if not Config.WebHookURL or Config.WebHookURL == "" then print("^1[Hata] Discord webhook URL'si yapılandırılmamış^0") return end local playerName = "Bilinmiyor" local identifier = "Bilinmiyor" local citizenId = "Bilinmiyor" local playerId = source -- Oyuncu ID'si için source kullan if player then -- Player objesi var mı kontrol et if CoreName == "qb-core" or CoreName == "qbx_core" then playerName = player.PlayerData.charinfo.firstname .. " " .. player.PlayerData.charinfo.lastname identifier = player.PlayerData.license citizenId = player.PlayerData.citizenid playerId = player.PlayerData.source -- QBCore için doğru kaynak elseif CoreName == "es_extended" then playerName = player.getName() identifier = player.identifier playerId = player.source -- ESX için doğru kaynak end end -- Şüpheli fiyatlandırma kontrolü local suspiciousPrice = false local suspiciousMessage = "" if price < 1000 then suspiciousPrice = true suspiciousMessage = "\n⚠️ **ŞÜPHELİ FİYAT TESPİT EDİLDİ!** ⚠️" end local time = os.date("%Y-%m-%d %H:%M:%S") -- Tüm detaylarla embed oluştur local embedData = { username = "Araç Satış Kaydı", embeds = { { title = "Araç Satın Alma Kaydı", color = suspiciousPrice and 15158332 or 3066993, description = "Bir oyuncu araç satın aldı" .. suspiciousMessage, fields = { {name = "Oyuncu Adı", value = tostring(playerName), inline = true}, {name = "ID", value = tostring(playerId), inline = true}, {name = "Tanımlayıcı", value = tostring(identifier), inline = false}, {name = "Vatandaş ID", value = tostring(citizenId), inline = false}, {name = "Araç Modeli", value = tostring(vehicle), inline = true}, {name = "Plaka", value = tostring(plate), inline = true}, {name = "Fiyat", value = "$" .. tostring(price), inline = true}, {name = "Ödeme Yöntemi", value = string.upper(tostring(paymentType)), inline = true}, {name = "Satın Alma Zamanı", value = tostring(time), inline = false} }, footer = { text = "Araç Satış Kayıt Sistemi" } } } } -- Eğer görsel URL'si yapılandırılmışsa küçük resim ekle if Config.ImageURL and Config.ImageURL ~= "" then embedData.embeds[1].thumbnail = { url = Config.ImageURL } end -- Şüpheli fiyatlandırma tespit edilirse @everyone etiketi ekle if suspiciousPrice then embedData.content = "@everyone Şüpheli araç satın alması tespit edildi!" end -- Webhook'u gönder PerformHttpRequest(Config.WebHookURL, function(err, text, headers) if err == 200 or err == 204 then print("^2[Bilgi] Araç satın alma kaydı başarıyla Discord webhook'una gönderildi.^0") else print("^1[Hata] Discord'a araç satın alma kaydı gönderilemedi. Durum kodu: " .. tostring(err) .. "^0") print("^1[Hata] Yanıt: " .. tostring(text) .. "^0") end end, 'POST', json.encode(embedData), {['Content-Type'] = 'application/json'}) end