Customize the scoreboard
Define native columns, fonts, colors and viewer-specific statistics from AMXX.
What can a server modify?
Partner servers can define a native table through papamovgui2_scoreboard.inc: title, footer, team names and scores, player rows, up to eight statistic columns, column widths/alignment, six RGBA colors, row height, font size and bold text. The renderer uses its bundled font and fixed table structure. It does not execute server scripts, load arbitrary fonts or accept model/file paths.
This interface is new source work requiring papamovgui2_scoreboard_v1 and a matching NextClient host where applicable. It is not enabled by a card-only capability. Complete the setup guide first. The platform's authenticated 1.6 Competitive match scoreboard cannot be replaced through partner messages.
Example and lifecycle
Download the complete native_scoreboard.sma example. It sends kills, deaths and ping once per second to each opted-in viewer.
#include <papamovgui2_scoreboard>
// plugin_init:
papamovgui2_board_init();
// One update for one connected viewer:
if (papamovgui2_board_available(viewer)) {
papamovgui2_board_begin(viewer, revision); // revision: 0..65535
papamovgui2_board_title(viewer, "Your server");
papamovgui2_board_column(viewer, 0, "Kills", 100);
papamovgui2_board_column(viewer, 1, "Money", 120);
papamovgui2_board_team(viewer, 2, ctScore, "Counter-Terrorists");
papamovgui2_board_team(viewer, 1, tScore, "Terrorists");
papamovgui2_board_player(viewer, player, team, alive, playerName);
papamovgui2_board_stat(viewer, player, 0, killsText);
papamovgui2_board_stat(viewer, player, 1, moneyText, PapamoBoardTeam);
papamovgui2_board_footer(viewer, "Your platform");
papamovgui2_board_commit(viewer, 3);
}begin starts a full replacement. Add every column and player you want in that snapshot. Omitted rows and cells disappear on the next successful commit; there is no inherited private data. Build a new revision for each update, wrapping at 65535. Revision identifies a transaction, not authoritative ordering.
Finish within two seconds. The client accepts at most 512 operations per transaction and ten commits per second. Use event-driven updates plus TTL renewal rather than sending full rosters at that maximum. The previous committed board stays visible while a valid replacement is built. Invalid native operations abort the replacement and preserve the previous board until its original expiry.
A committed board appears on Tab. Its TTL is 1–10 seconds; renew it before expiry. Expired snapshots, missing session ownership, another endpoint or unavailable VGUI2 return control to the normal scoreboard. papamovgui2_board_reset(viewer) clears it immediately. All functions returning true mean queued, not acknowledged or painted.
Style
new colors[6][4] = {
{24, 24, 18, 240}, // background
{189, 163, 93, 255}, // border
{243, 240, 231, 255},// text
{212, 179, 107, 255},// accent
{168, 200, 232, 255},// CT
{223, 187, 128, 255} // T
};
papamovgui2_board_style(viewer, colors, 24, 15, false);Call style between begin and commit. Values are red/green/blue/alpha, each 0–255. Row height is 18–32 and font size 12–20 in logical layout units. The table fits the viewport; these are not guaranteed physical screen pixels. Square borders and the name column remain part of the renderer's structure.
Privacy scopes
| Scope | Server dispatch behavior |
|---|---|
PapamoBoardPublic | Send value to this viewer |
PapamoBoardSelf | Send only when viewer and subject slots match |
PapamoBoardTeam | Send only when viewer and subject are connected members of the same T/CT team |
Disallowed cells are sent as empty strings. Private values never travel to unauthorized viewers for client-side hiding. Spectators do not receive team-scoped cells. For custom teams or spectator permissions, apply your own authorization before calling with Public; never pass a secret to an unauthorized viewer. One transaction targets one viewer, not a broadcast audience.
Limits and API
| Function | Contract |
|---|---|
papamovgui2_board_init() | Initialize once in plugin_init |
papamovgui2_board_available(viewer) | Current connection user ID and capability handshake younger than four seconds |
papamovgui2_board_begin(viewer, revision) | Full replacement; revision 0–65535 |
papamovgui2_board_title(viewer, title) | Nonempty, at most 128 UTF-8 bytes / 64 characters |
papamovgui2_board_style(viewer, colors, rowHeight=24, fontSize=15, bold=false) | Six RGBA colors and bundled font controls |
papamovgui2_board_column(viewer, column, label, width=100, right=true) | Indices 0–7, contiguous from 0; widths 40–220, total at most 750; nonempty label at most 96 bytes / 24 characters |
papamovgui2_board_team(viewer, team, score, label="") | T=1, CT=2; score 0–65535; label at most 96 bytes / 32 characters |
papamovgui2_board_player(viewer, player, team, alive, name) | Slot 1–32; team 0–3; nonempty name at most 96 bytes / 32 characters |
papamovgui2_board_stat(viewer, player, column, value, scope=PapamoBoardPublic) | Add player and column first; value at most 96 bytes / 32 characters |
papamovgui2_board_footer(viewer, text) | At most 160 bytes / 96 characters |
papamovgui2_board_commit(viewer, seconds=3) | At least one column; TTL 1–10 seconds |
papamovgui2_board_reset(viewer) | Hide board and abort pending replacement |
Native strings must be valid UTF-8 without control characters. The renderer clips text to its column width. Sanitise incoming player names before building snapshots if your server allows control codes or legacy non-UTF-8 encodings. A changed player name/team clears old cell values in the receiver.
Transport and rendering
The dedicated capability command is papamovgui2_board 1. 16CBoard messages are variable length, at most 190 bytes. Their header is version 1, operation byte and little-endian 16-bit transaction revision. The include handles packing. Stock clients and card-only clients receive no board packets unless they advertise the separate capability. Capability is display-only and can be falsified by clients.
The owned input worker builds text and cached geometry only when committed layout data changes. Tab visibility does not require Electron screenshots or repeated atlas transfers. The native panel rechecks the live lease, endpoint, immutable prepared content and absolute snapshot expiry before delayed painting. In-game performance and platform coverage still require release validation.