small tweaks

This commit is contained in:
MrNewb committed 2025-06-21 07:53:49 -04:00
1 parent 4817b092fb
commit 854482094a
3 files changed
+9 -9

No files matched your search

+6 -6
View File
@@ -1,7 +1,7 @@
Logs = Logs or {} Logs = Logs or {}
local WebhookURL = "" -- Add webhook URL here if using built-in logging system local WebhookURL = BridgeServerConfig.WebhookURL -- Add webhook URL here if using built-in logging system
local LogoForEmbed = "" -- optional logo for the embed local LogoForEmbed = BridgeServerConfig.WebhookImage -- optional logo for the embed
---This will send a log to the configured webhook or log system. ---This will send a log to the configured webhook or log system.
---@param src number ---@param src number
@@ -9,7 +9,8 @@ local LogoForEmbed = "" -- optional logo for the embed
---@return nil ---@return nil
Logs.Send = function(src, message) Logs.Send = function(src, message)
if not src or not message then return end if not src or not message then return end
if BridgeServerConfig.LogSystem == "built-in" then local logType = BridgeServerConfig.LogSystem or "built-in"
if logType == "built-in" then
PerformHttpRequest(WebhookURL, function(err, text, headers) end, 'POST', json.encode( PerformHttpRequest(WebhookURL, function(err, text, headers) end, 'POST', json.encode(
{ {
username = "Community_Bridge's Logger", username = "Community_Bridge's Logger",
@@ -19,7 +20,6 @@ Logs.Send = function(src, message)
color = "15769093", color = "15769093",
title = GetCurrentResourceName(), title = GetCurrentResourceName(),
url = 'https://discord.gg/Gm6rYEXUsn', url = 'https://discord.gg/Gm6rYEXUsn',
--description = message,
thumbnail = { url = LogoForEmbed }, thumbnail = { url = LogoForEmbed },
fields = { fields = {
{ {
@@ -46,9 +46,9 @@ Logs.Send = function(src, message)
} }
} }
}), { ['Content-Type']= 'application/json' }) }), { ['Content-Type']= 'application/json' })
elseif BridgeServerConfig.LogSystem == "qb" then elseif logType == "qb" then
return TriggerEvent('qb-log:server:CreateLog', GetCurrentResourceName(), GetCurrentResourceName(), 'green', message) return TriggerEvent('qb-log:server:CreateLog', GetCurrentResourceName(), GetCurrentResourceName(), 'green', message)
elseif BridgeServerConfig.LogSystem == "ox_lib" then elseif logType == "ox_lib" then
return lib.logger(src, GetCurrentResourceName(), message) return lib.logger(src, GetCurrentResourceName(), message)
end end
end end
+2 -2
View File
@@ -299,12 +299,12 @@ end
---@param src number ---@param src number
---@param status boolean ---@param status boolean
---@return boolean ---@return boolean
Framework.SetPlayerDuty = function(src, dutystatus) Framework.SetPlayerDuty = function(src, status)
local xPlayer = Framework.GetPlayer(src) local xPlayer = Framework.GetPlayer(src)
if not xPlayer then return false end if not xPlayer then return false end
local job = xPlayer.getJob() local job = xPlayer.getJob()
if not job.onDuty then return false end if not job.onDuty then return false end
xPlayer.setJob(job.name, job.grade, dutystatus) xPlayer.setJob(job.name, job.grade, status)
return true return true
end end
+1 -1
View File
@@ -1,6 +1,6 @@
BridgeServerConfig = {} BridgeServerConfig = {}
BridgeServerConfig.LogSystem = "built-in" -- [ built-in | qb | ox_lib ] BridgeServerConfig.LogSystem = "built-in" -- [ built-in | qb | ox_lib ]
BridgeServerConfig.WebhookURL = "PUT_WEBHOOK_URL_HERE" -- only if using builtin BridgeServerConfig.WebhookURL = "" -- only if using builtin, put in the channels webhook url
BridgeServerConfig.WebhookImage = "https://cdn.discordapp.com/avatars/299410129982455808/31ce635662206e8bd0132c34ce9ce683?size=1024" BridgeServerConfig.WebhookImage = "https://cdn.discordapp.com/avatars/299410129982455808/31ce635662206e8bd0132c34ce9ce683?size=1024"
BridgeServerConfig.MaxInventorySlots = 50 BridgeServerConfig.MaxInventorySlots = 50