Romania XPlayZM.CSBlackDevil.COM # Zombie Plague UltimateX [ Respawn + FDL + VIP 22-12PM + POINTS] ® 25/32
Unknown ❤ RESPAWN.ZAFEST.RO | VIP FREE | FREE FOR ALL ❤ 0/32
France EMIRATES.KiNGS 亗 GAMEAREA ||͇̿P͇̿U͇̿B͇̿L͇̿I͇̿C͇̿| ✪ 32/32
Server bewerben
17 lines 6.4 KiB Markdown Source Rendered Raw Permalink History
---
title: "Setting Up a Stats System (CSStats and Rankings)"
excerpt: "How the AMX Mod X csx module and its stats plugins build a ranking from live play, where the csstats.dat file lives, the say /rank and /top15 commands, and how to tune what shows on death."
category: "administration"
tags: "stats, csstats"
image: ""
read_time: "8 min read"
---
<p>A working rank system keeps players coming back &mdash; they want to climb. On CS 1.6 the standard, no-database way to do this is the <strong>csx</strong> module that ships with AMX Mod X plus its bundled stats plugins. It tracks kills, deaths, headshots and objectives, computes a rank, and shows a HUD summary when you die. No MySQL, no external service; the data lives in one file on the server.</p><h2>1. Confirm the csx module is loaded</h2><p>Ranking is powered by the <code>csx</code> module, not a plugin alone. Check it is enabled in <code>addons/amxmodx/configs/modules.ini</code> (the line <code>csx</code>), then confirm at runtime from the server console:</p><pre>amxx modules</pre><p><code>csx</code> must read <code>running</code>. If it is missing, ranking natives are unavailable and every stats plugin silently does nothing. The module is part of a normal <a href="/tutorials/install-amx-mod-x-1-9">AMX Mod X 1.9 install</a>.</p><h2>2. Enable the stats plugins</h2><p>Two plugins do the visible work; add them to <code>addons/amxmodx/configs/plugins.ini</code> if they are commented out:</p><pre>stats.amxx      ; rank commands: /rank /top15 /stats
statsx.amxx     ; HUD stats shown to a player when they die</pre><p>Load order is not critical here, but keep them below <code>admin.amxx</code> as usual &mdash; see <a href="/tutorials/plugins-ini-load-order">plugins.ini load order</a>. Change the map after editing, because <code>plugins.ini</code> is only re-read on map change or restart.</p><h2>3. Where the ranking is stored</h2><p>The rank database is a single binary file:</p><pre>cstrike/addons/amxmodx/data/csstats.dat</pre><p>Every player's accumulated kills, deaths, headshots, hits and objective actions live here, keyed by SteamID. Back this file up &mdash; losing it wipes every rank. A few cvars control how it grows and behaves; set them in <code>amxx.cfg</code> or a dedicated config:</p><pre>csstats_maxsize 3000    // max number of players kept in the ranking
csstats_reset 0         // set to 1 once to wipe the ranking, then back to 0
csstats_rank 1          // 1 = rank by an algorithm using K/D and more</pre><p>Raise <code>csstats_maxsize</code> on a busy server or old players get pruned to make room; lower it if the file grows unwieldy. To wipe the ranking cleanly, set <code>csstats_reset 1</code>, change map once, then set it back to <code>0</code> so it does not wipe again on every load.</p><h2>4. The commands players will use</h2><p>Once <code>stats.amxx</code> runs, players get chat triggers:</p><pre>say /rank      // your rank, kills, deaths, K/D, accuracy
say /top15     // the server leaderboard
say /stats     // detailed personal stats
say /statsme   // same, alternate trigger on some builds</pre><p>Advertise these in your <a href="/tutorials/motd-txt-html-guide">MOTD</a> or with an <a href="/plugins/csb-adverts">adverts plugin</a> so players discover them. The leaderboard is what drives the competition, so make <code>/top15</code> visible.</p><h2>5. Tune the death HUD (statsx)</h2><p><code>statsx.amxx</code> shows the "you killed / were killed by" breakdown after each death, and it has its own cvars to control how much detail appears:</p><pre>amx_statsx_mode 1       // 0 off, 1 normal HUD, 2 detailed
amx_statsx_duration 12  // seconds the panel stays on screen
amx_statsx_freq 2       // how often the round-end summary is shown</pre><p>Keep the duration short; a stats panel that lingers into the next round annoys players. The weapon icons and names shown come from <code>addons/amxmodx/configs/stats.ini</code>, which maps each weapon to its display &mdash; leave it alone unless you add custom weapons.</p><h2>6. How the rank number is computed</h2><p>Players will ask why their rank moved, so it helps to know the model. The csx ranking is not a raw kill count &mdash; it weighs kills against deaths, rewards headshots and objective actions (planting, defusing, hostage rescues), and normalizes so a player with 100 kills and 20 deaths outranks one with 200 kills and 250 deaths. Two consequences worth telling players: farming kills while dying constantly barely moves your rank, and objective play counts even when your K/D is mediocre. This is why <code>csstats_rank 1</code> feels fairer than a pure frag ladder. If you would rather rank purely by kills, some builds accept an alternate value, but the default weighted model is what keeps a public server's ladder honest and is worth leaving on. The one thing that resets everyone's position is a wipe of <code>csstats.dat</code>, so guard that file.</p><h2>Common errors</h2><ul><li><strong>/rank returns nothing or "unknown command"</strong> &mdash; <code>stats.amxx</code> is not in <code>plugins.ini</code>, or the <code>csx</code> module is not running. Check <code>amxx plugins</code> and <code>amxx modules</code>.</li><li><strong>Ranks reset every map</strong> &mdash; <code>csstats_reset</code> was left at <code>1</code>. Set it to <code>0</code> after a deliberate wipe.</li><li><strong>Ranking never persists across restarts</strong> &mdash; the server has no write permission to <code>addons/amxmodx/data/</code>, so <code>csstats.dat</code> cannot be saved. Fix the directory ownership.</li><li><strong>New players push old ones out</strong> &mdash; <code>csstats_maxsize</code> is too small for your traffic. Raise it.</li><li><strong>Stats count on a non-Steam server look wrong</strong> &mdash; ranks are keyed by SteamID, and if <a href="/tutorials/find-player-steamid">non-Steam IDs collide</a> two people share one rank. Configure Reunion to hand out stable IDs.</li></ul><h2>Verification</h2><p>Play a round, get a kill, then type <code>say /rank</code> &mdash; your kill count should increment. Restart the server and check <code>/rank</code> again; if your numbers survived the restart, <code>csstats.dat</code> is being written correctly. Finally, confirm the death HUD from <code>statsx</code> appears and clears within the duration you set. For a database-backed ranking that survives across multiple servers you would move to an SQL stats plugin, but for a single box the csx system above is the reliable default.</p>