PlayerMetrics is an SCP:SL server plugin that tracks and displays the time players spend on the server. It is mostly useful for server head admins to track play time requirements for admins and inter admins, but it can also be used in many different ways.
If you are using a Linux server, you can enter this command in your terminal to download and install the plugin automatically:
curl -s https://raw.githubusercontent.com/MollyIO/PlayerMetrics/main/install.sh | bash- Download the latest release
Go to the Releases page and download:PlayerMetrics.dlldependencies.zip
- Locate your LabAPI directories
Global paths:If you want to install for a specific server port instead of globally, create folders named with the port number:<SERVER CONFIG PATH>/LabAPI/plugins/global/ <SERVER CONFIG PATH>/LabAPI/dependencies/global/<SERVER CONFIG PATH>/LabAPI/plugins/<PORT>/ <SERVER CONFIG PATH>/LabAPI/dependencies/<PORT>/ - Copy files
- Place
PlayerMetrics.dllinto thepluginsfolder (globalor<PORT>). - Extract
dependencies.zipinto the correspondingdependenciesfolder.
- Place
- Restart the server
After copying the files, restart your SCP: Secret Laboratory server to apply the plugin. - Verify installation
Check the server console for messages confirming that PlayerMetrics loaded correctly.
After installation, a configuration file named config.yaml will be created in the <SERVER CONFIG PATH>/LabAPI/config/<PORT OR GLOBAL>/PlayerMetrics directory. You can modify this file to customize the plugin's behavior. Default config is shown below:
# Determines if the plugin should automatically check for updates on startup and download them.
use_auto_updater: true
# Determines if the command checks whether a player has the 'playermetrics.info' or 'playermetrics.top' or 'playermetrics.specific' permission. Disable this to allow all players with access to the RA to use the PlayerMetrics command.
check_permissions: trueWhen a player joins the server, their join time is recorded and when they leave, this record is saved to a database.
If you use check_permission in the plugin config, make sure to give the appropriate permissions to your admins or players who should be able to use the commands. The permissions are:
playermetrics.info- Allows the use of theplayermetrics infocommand.playermetrics.top- Allows the use of theplayermetrics topcommand.playermetrics.specific- Allows the use of theplayermetrics specificcommand.
Also if you want to give specific admin access to all commands, you can give them the playermetrics.* permission.
Also you can give this permissions to a regular players so they can check their own stats using default console accessed by pressing ~. They won't be able to check other players stats.
The plugin provides the following commands to access player metrics:
| Command | Description | Example |
|---|---|---|
playermetrics info <SteamID or Nickname> |
Displays detailed metrics for the specified player. If no player is specified, shows metrics for yourself. Metrics include: first seen, last seen, number of sessions, total playtime, average session time, and playtime over the last 1, 3, 7, 14, 30, 90, and 365 days. | playermetrics info 76561197999281035 |
playermetrics specific <SteamID or Nickname> <period> |
Shows how much time a player has spent on the server during a specific period. Period format: 1y (year), 31d (days), 24h (hours), 60m (minutes). |
playermetrics specific 76561197999281035 7d |
playermetrics top <n> |
Displays the top n players with the highest total playtime. Default: n = 10, maximum is 150. |
playermetrics top 20 |
If you are a developer and want to contribute to this project, feel free to fork the repository and submit pull requests. 😊
Also, if you are developing a plugin and want to use PlayerMetrics as a dependency, you can include it in your project references and use static Instances in PlayerMetrics.cs to access its methods and other stuff.
This project is licensed under the MIT License. See the LICENSE file for details.