Documentation / Discord ranking

Discord ranking

Public Discord leaderboards (zombies, fishing, items…) with buttons and pagination. Premium plan.

Publish up to 2 panels per server. The channel message shows the top; each player clicks View ranking and browses a message only they can see. Premium plan · WebLogs ≥ 9.6.

Setup

  1. 1My servers → DiscordBot → Connect (same bot as VIP, tickets and giveaways).
  2. 2Ranking menu: categories (Zombies is created automatically), emoji, reset and 24h/7d views, embed style.
  3. 3New panel → Discord channel + categories → Publish.
  4. 4In FiveM, add points with the export (or Adictos_Zombies already calls it on kills).
Staff: View ranking / Manage ranking permissions. FiveM → panel flush: Panel Settings → Flush Ranking (5 min by default).

Periods, reset and events

In each category you can enable the Today, 7 days, 30 days and All-time views. Periods are calculated on calendar days, so Today starts empty at midnight just like an in-game daily ranking. You can also set the start and end of an event: only points within those dates count; when it ends the winner (and top 10) is recorded and the leaderboard is cleared. The reset every N days clears the all-time board automatically (panel cron).

Where points are stored

The tables are created automatically when you open Ranking or when the first batch arrives. With the Export source, points accumulate in the panel (ranking_scores, Rockstar licence without the license: prefix). With the ox_inventory or qb_inventory source, the ranking is read live from the inventory JSON in the same MySQL as the panel. The public embed interval is configured under Panel Settings → Discord.

Table / fieldWhat for
ranking_categoriesCategories (key, emoji or no emoji, reset, views, source)
ranking_scoresAll-time totals from the export
ranking_scores_dailyDaily buckets: one row per player, category and day (Today / 7d / 30d rankings)
ranking_event_winnersWinner and metadata when an event closes
ranking_event_standingsAll archived standings; retention = the plan’s log days (Free/Premium)
ranking_panelsUp to 2 Discord messages (channel, categories, refresh)
servers.weblogs_ranking_configJSON: module on/off, colour, footer, rows per page
Inventory: in the category choose ox_inventory or qb_inventory and the server item (same MySQL as the panel). Export: type any key or use a shortcut (Zombies, Fishing, Missions, crops, Logging, Mining…). A new export category is also created automatically when the first batch arrives.

Export (Adictos_WebLogs)

In-memory cache in FiveM and sending to the panel every N seconds (Panel Settings → Flush Ranking; 60 s by default). Optional delta (1 by default).

exports['Adictos_WebLogs']:Ranking(source, 'Zombies')
exports['Adictos_WebLogs']:Ranking(source, 'pesca')
exports['Adictos_WebLogs']:Ranking(source, 'MisionesDiarias')
exports['Adictos_WebLogs']:Ranking(source, 'Tomate', cantidad)
exports['Adictos_WebLogs']:Ranking(source, 'Zombies', 1)  -- delta
Adictos_Zombies already calls the export on kills. Adictos_Quest adds MisionesDiarias/Semanales/Mensuales + MisionesTotales on hand-in. In other scripts (harvesting, smelting, logging…), one line per event.

Reading the leaderboard from a script (RankingBoard)

For pause menus, HUDs or your own scripts you can request the top from the panel (same leaderboard as Discord). Requires WebLogs ≥ 9.6 and the category to exist under Ranking → Categories.

-- Histórico, página 1
exports['Adictos_WebLogs']:RankingBoard('zombies', 1, nil, function(ok, board)
    if not ok or type(board) ~= 'table' then return end
    for _, e in ipairs(board.entries or {}) do
        print(('#%s %s — %s'):format(e.rank, e.player_name, e.score))
    end
end)

-- Ranking 7 días (period: 0=histórico, 1=24h, 7, 30)
exports['Adictos_WebLogs']:RankingBoard('pesca', 1, 7, function(ok, board) ... end)

-- Atajo: solo callback (página 1, histórico)
exports['Adictos_WebLogs']:RankingBoard('zombies', function(ok, board) ... end)

exports['Adictos_WebLogs']:RankingFlush()        -- forzar envío de puntos pendientes
exports['Adictos_WebLogs']:RankingPendingCount() -- cuántos hay en caché
Board fieldWhat it contains
entries[]Each row: rank, player_name, score, license
total / page / pagesPagination (rows per page = Ranking → Embed)
period_days0 all-time · 1 24h · 7 · 30
period_labelReadable text of the active period
categoryMetadata (label, emoji, export/inventory source)
The category key is the same one used when adding points (zombies, pesca…). WebLogs normalises it to lowercase. The panel caches the board for a few seconds (Panel Settings → RankingBoard cache, default 15 s) for pause menus with many players; it is invalidated when new points arrive. Live inventory categories (ox/qb) are not cached.

What the embed looks like

Public message (default category, first page). Colour and footer are edited under Ranking → Embed.

Weekly ranking — 🧟 Zombies
🥇 Carlos — 1.234
🥈 María — 890
🥉 Luis — 512
#4 Ana — 120
#5 Pedro — 98
24h · Top 10 · Click View ranking to page through (only you)
🧟 Zombies🐟 Fishing24h7 daysView ranking
When you click View ranking, another category or a period (24h / 7 days), Discord replies with an ephemeral message (only you) and ◀ ▶ buttons. The channel message doesn’t change for everyone else.

Troubleshooting

ProblemWhat to check
Points don’t go upWebLogs ≥ 9.6, Ranking module ON, export with the player’s source, flush in Panel Settings
Embed isn’t postedDiscordBot connected; text channel; the bot can send embeds and buttons
Buttons don’t respondThe bot’s Interactions Endpoint URL pointing to the panel (as with giveaways)
401 Unauthorized when postingInvalid bot token. Panel Settings → Discord: paste the Bot Token (Bot → Reset Token), not the Public Key. Invite the bot under My servers → DiscordBot.
Inventory at 0Choose the ox_inventory/qb_inventory source and the correct item; same MySQL as the panel. Or use Export and call Ranking(src, key).