local QBCore = exports['qb-core']:GetCoreObject()
local Webhooks = {
['default'] = '',
['testwebhook'] = '',
['playermoney'] = '',
['playerinventory'] = '',
['robbing'] = '',
['cuffing'] = '',
['drop'] = '',
['trunk'] = '',
['stash'] = '',
['glovebox'] = '',
['banking'] = '',
['vehicleshop'] = '',
['vehicleupgrades'] = '',
['shops'] = '',
['dealers'] = '',
['storerobbery'] = '',
['bankrobbery'] = '',
['powerplants'] = '',
['death'] = '',
['joinleave'] = '',
['ooc'] = '',
['report'] = '',
['me'] = '',
['pmelding'] = '',
['112'] = '',
['bans'] = ',
['anticheat'] = '',
['weather'] = '',
['moneysafes'] = '',
['bennys'] = '',
['bossmenu'] = '',
['robbery'] = '',
['casino'] = '',
['traphouse'] = '',
['911'] = '',
['palert'] = '',
['house'] = '',
}
local Colors = { --
['default'] = 14423100,
['blue'] = 255,
['red'] = 16711680,
['green'] = 65280,
['white'] = 16777215,
['black'] = 0,
['orange'] = 16744192,
['yellow'] = 16776960,
['pink'] = 16761035,
["lightgreen"] = 65309,
}
RegisterNetEvent('qb-log:server:CreateLog', function(name, title, color, message, tagEveryone)
local tag = tagEveryone or false
local webHook = Webhooks[name] or Webhooks[']
local embedData = {
{
['title'] = title,
['color'] = Colors[color] or Colors['default'],
['footer'] = {
['text'] = os.date('%c'),
},
['description'] = message,
['author'] = {
['name'] = 'QBCore Logs',
['icon_url'] = '
},
}
}
PerformHttpRequest(webHook, function() end, 'POST', json.encode({ username = 'QB Logs', embeds = embedData}), { ['Content-Type'] = 'application/json' })
Wait(100)
if tag then
PerformHttpRequest(webHook, function() end, 'POST', json.encode({ username = 'QB Logs', content = '@everyone'}), { ['Content-Type'] = 'application/json' })
end
end)
QBCore.Commands.Add('testwebhook', 'Test Your Discord Webhook For Logs (God Only)', {}, false, function()
TriggerEvent('qb-log:server:CreateLog', 'testwebhook', 'Test Webhook', 'default', 'Webhook setup successfully')
end, 'god')
Nasıl log sistemi aktifleştirebilirim?
local Webhooks = {
['default'] = '',
['testwebhook'] = '',
['playermoney'] = '',
['playerinventory'] = '',
['robbing'] = '',
['cuffing'] = '',
['drop'] = '',
['trunk'] = '',
['stash'] = '',
['glovebox'] = '',
['banking'] = '',
['vehicleshop'] = '',
['vehicleupgrades'] = '',
['shops'] = '',
['dealers'] = '',
['storerobbery'] = '',
['bankrobbery'] = '',
['powerplants'] = '',
['death'] = '',
['joinleave'] = '',
['ooc'] = '',
['report'] = '',
['me'] = '',
['pmelding'] = '',
['112'] = '',
['bans'] = ',
['anticheat'] = '',
['weather'] = '',
['moneysafes'] = '',
['bennys'] = '',
['bossmenu'] = '',
['robbery'] = '',
['casino'] = '',
['traphouse'] = '',
['911'] = '',
['palert'] = '',
['house'] = '',
}
local Colors = { --
Linkleri,görmek için
Giriş yap veya üye ol.
['default'] = 14423100,
['blue'] = 255,
['red'] = 16711680,
['green'] = 65280,
['white'] = 16777215,
['black'] = 0,
['orange'] = 16744192,
['yellow'] = 16776960,
['pink'] = 16761035,
["lightgreen"] = 65309,
}
RegisterNetEvent('qb-log:server:CreateLog', function(name, title, color, message, tagEveryone)
local tag = tagEveryone or false
local webHook = Webhooks[name] or Webhooks[']
local embedData = {
{
['title'] = title,
['color'] = Colors[color] or Colors['default'],
['footer'] = {
['text'] = os.date('%c'),
},
['description'] = message,
['author'] = {
['name'] = 'QBCore Logs',
['icon_url'] = '
Linkleri,görmek için
Giriş yap veya üye ol.
',},
}
}
PerformHttpRequest(webHook, function() end, 'POST', json.encode({ username = 'QB Logs', embeds = embedData}), { ['Content-Type'] = 'application/json' })
Wait(100)
if tag then
PerformHttpRequest(webHook, function() end, 'POST', json.encode({ username = 'QB Logs', content = '@everyone'}), { ['Content-Type'] = 'application/json' })
end
end)
QBCore.Commands.Add('testwebhook', 'Test Your Discord Webhook For Logs (God Only)', {}, false, function()
TriggerEvent('qb-log:server:CreateLog', 'testwebhook', 'Test Webhook', 'default', 'Webhook setup successfully')
end, 'god')
Nasıl log sistemi aktifleştirebilirim?
Son düzenleme: