config.server.lua
Preview File Updated: v1.0.3 - 03/03/2025
SV = {}
-- ██╗ ██╗███████╗██████╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗
-- ██║ ██║██╔════╝██╔══██╗██║ ██║██╔═══██╗██╔═══██╗██║ ██╔╝██╔════╝
-- ██║ █╗ ██║█████╗ ██████╔╝███████║██║ ██║██║ ██║█████╔╝ ███████╗
-- ██║███╗██║██╔══╝ ██╔══██╗██╔══██║██║ ██║██║ ██║██╔═██╗ ╚════██║
-- ╚███╔███╔╝███████╗██████╔╝██║ ██║╚██████╔╝╚██████╔╝██║ ██╗███████║
-- ╚══╝╚══╝ ╚══════╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
SV.Webhooks = {
-- "SCREENSHOT" WEBHOOK is used on client-side for screenshot-basic upload - recommended to using other non-used webhook for that.
['SCREENSHOT'] = "",
['NEW_REPORT'] = "",
['CLOSE_REPORT'] = "",
}
SV.WebhookText = {
['TITLE.NEW_REPORT'] = "🚩 New Report",
['DESCRIPTION.NEW_REPORT'] = "**Report ID:** %s\n**Report Creator:** %s\n\n**Type:** %s\n**Title:** %s\n**Description:** %s",
['TITLE.CLOSE_REPORT'] = "❌ Close Report",
['DESCRIPTION.CLOSE_REPORT'] = "**Report ID:** %s\n**Report Creator:** %s (%s)\n\n**Type:** %s\n**Title:** %s\n**Description:** %s\n\n**Claimed By:** %s (%s)\n**Closed By:** %s (%s)",
}
SV.Webhook = function(webhook_id, title, description, image, color, footer)
local DiscordWebHook = SV.Webhooks[webhook_id]
local embeds = {{
["title"] = title,
["type"] = "rich",
["description"] = description,
["color"] = color,
["image"] = {url = image},
["footer"] = {
["text"] = footer..' - '..os.date(),
},
}}
PerformHttpRequest(DiscordWebHook, function(err, text, headers) end, 'POST', json.encode({embeds = embeds}), {['Content-Type'] = 'application/json'})
end
-- ███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
-- ██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
-- █████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
-- ██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
-- ██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
-- ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
SV.getPlayer = function(src)
if Config.Core == "ESX" then
return Core.GetPlayerFromId(src)
elseif Config.Core == "QB-Core" then
return Core.Functions.GetPlayer(src)
end
end
SV.getIdentifier = function(xPlayer)
if Config.Core == "ESX" then
return xPlayer.identifier
elseif Config.Core == "QB-Core" then
return xPlayer.PlayerData.citizenid
end
end
SV.getPlayerByIdentifier = function(identifier)
if Config.Core == "ESX" then
return Core.GetPlayerFromIdentifier(identifier)
elseif Config.Core == "QB-Core" then
return Core.Functions.GetPlayerByCitizenId(identifier)
end
end
SV.getCharacterName = function(xPlayer)
if Config.Core == "ESX" then
return xPlayer.getName()
elseif Config.Core == "QB-Core" then
return xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname
end
end
SV.checkIsAdmin = function(xPlayer)
if Config.Core == "ESX" then
return xPlayer.group
elseif Config.Core == "QB-Core" then
return Core.Functions.GetPermission(xPlayer.PlayerData.source)
end
end
SV.banPlayer = function(xAdmin, xTarget)
if Config.Core == "ESX" then
elseif Config.Core == "QB-Core" then
end
end
SV.getInventory = function(xPlayer)
if Config.Core == "ESX" then
return xPlayer.getInventory(), xPlayer.getLoadout(), xPlayer.getAccounts()
elseif Config.Core == "QB-Core" then
return xPlayer.PlayerData.items, nil, xPlayer.PlayerData.money
end
end
SV.kickPlayer = function(xAdmin, xTarget)
if Config.Core == "ESX" then
DropPlayer(xTarget.source, "You has been kicked from the server by @"..GetPlayerName(xAdmin.source))
elseif Config.Core == "QB-Core" then
DropPlayer(xTarget.PlayerData.source, "You has been kicked from the server by @"..GetPlayerName(xAdmin.PlayerData.source))
end
end
Last updated
Was this helpful?