config.server.lua
Preview File Updated: v2.0.0 - 22.08.2026
SV = {}
-- ███████╗██████╗ █████╗ ███╗ ███╗███████╗██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
-- ██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝
-- █████╗ ██████╔╝███████║██╔████╔██║█████╗ ██║ █╗ ██║██║ ██║██████╔╝█████╔╝
-- ██╔══╝ ██╔══██╗██╔══██║██║╚██╔╝██║██╔══╝ ██║███╗██║██║ ██║██╔══██╗██╔═██╗
-- ██║ ██║ ██║██║ ██║██║ ╚═╝ ██║███████╗╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗
-- ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
SV.GetPlayer = function(src)
if Config.Core == "ESX" then
return Core.GetPlayerFromId(src)
elseif Config.Core == "QB-Core" or Config.Core == "QBX" 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" or Config.Core == "QBX" then
return xPlayer.PlayerData.citizenid
end
end
SV.GetSource = function(xPlayer)
if Config.Core == "ESX" then
return xPlayer.source
elseif Config.Core == "QB-Core" or Config.Core == "QBX" then
return xPlayer.PlayerData.source
end
end
SV.RegisterCommand = function(command, groups, cb, help, suggestions)
if Config.Core == "ESX" then
local arguments = {}
if suggestions then
for k, v in pairs(suggestions) do
table.insert(arguments, {
name = v.name,
help = v.label,
type = 'any'
})
end
end
Core.RegisterCommand(command, groups, function(xPlayer, args, showError)
local src = SV.GetSource(xPlayer)
cb(src, args)
end, false, {
help = help,
arguments = arguments
})
elseif Config.Core == "QB-Core" or Config.Core == "QBX" then
local arguments = {}
if suggestions then
for k, v in pairs(suggestions) do
table.insert(arguments, {
name = v.name,
help = v.label
})
end
end
Core.Commands.Add(command, help, arguments, false, function(source, args)
cb(source, args)
end, groups)
end
endLast updated