A SourceMod plugin that tracks live player data and exports it to a formatted JSON file. This is particularly useful for web panels, Discord bots, or external server monitoring tools that need to fetch real-time player statistics (SteamID, IP, Country, Session Time, and Ping).
- JSON Data Export: Automatically writes live server data to a
.jsonfile at a customizable interval. - GeoIP Integration: Automatically resolves player IPs to their respective 2-letter country codes.
- Session Tracking: Accurately calculates how long each player has been connected to the server.
- Silent Mode: Allows admins or automated scripts to trigger a JSON write without spamming the server console.
- Safe String Escaping: Automatically escapes special characters in player names to prevent broken JSON files.
- SourceMod (v1.10 or newer recommended)
- GeoIP Extension (Included with SourceMod by default)
- Compile the
.spfile or download the compiled.smxfile. - Place the
csgo_panel_status.smx(or whatever you named it) into youraddons/sourcemod/plugins/directory. - Restart your server or load the plugin manually via the server console:
sm plugins load csgo_panel_status - A configuration file will automatically be generated at
cfg/sourcemod/panel_status.cfgupon first load.
| Command | Admin Flag | Description |
|---|---|---|
sm_panel_status |
ADMFLAG_GENERIC (b) |
Prints the player list to your console and triggers a manual JSON export. |
sm_panel_status silent |
ADMFLAG_GENERIC (b) |
Forces a JSON export without printing anything to the console. Great for cron jobs. |
You can edit these values in cfg/sourcemod/panel_status.cfg.
sm_panel_write_enabled(Default: 1)1= Enables writing to the JSON file.0= Disables JSON writing.
sm_panel_output_file(Default: "status.json")- The name of the generated JSON file.
- Note: The file is always generated inside the
addons/sourcemod/data/folder.
sm_panel_write_interval(Default: 10.0)- How often (in seconds) the plugin should automatically update the JSON file.
- Set to
0to disable the timer and update only when thesm_panel_statuscommand is used.
The exported file (addons/sourcemod/data/status.json) will look like this:
{
"TimeUtc": "2023-10-27T14:30:00Z",
"PlayerCount": 2,
"Players": [
{
"UserId": 4,
"Name": "PlayerOne",
"SteamId": "STEAM_1:0:12345678",
"Ip": "192.168.1.1",
"Country": "US",
"Ping": 45,
"SessionSeconds": 3650,
"SessionTime": "01:00:50"
},
{
"UserId": 5,
"Name": "PlayerTwo",
"SteamId": "STEAM_1:1:87654321",
"Ip": "10.0.0.1",
"Country": "TR",
"Ping": 22,
"SessionSeconds": 450,
"SessionTime": "07:30"
}
]
}Created by PoncikMarket. Version: 1.5.1