Integrando com o FiveGuard
AddEventHandler('fg:BanHandler', function(BanId, data, additional_info, screenshot_url)
local reason = data.reason
local discordId = data.discord
local license = data.license
if (not discordId or discordId == '') and (not license or license == '') then
print('^1[RNLD:FGM] Ban falhou: Nenhum identificador encontrado^0')
return
end
local reasonAll = string.format('Banimento pela API efetuado via FiveGuard. BanId: %d Motivo: %s', BanId or 'N/A', reason or 'N/A')
local banOptions = { reason = reasonAll }
if discordId and discordId ~= '' then
banOptions.discord_id = discordId
else
banOptions.license = license
end
-- Utiliza o exports nativo do rnld_api
exports['rnld_api']:toggleBan(banOptions)
end)Atualizado