This plugin is NOT recommended to be used with Left4Dead (yet), ESPECIALLY with forked servers (never). USE AT YOUR OWN RISK!
This plugin lets you track how long specific people have played on any servers that you have this plugin installed on. It uses a MySQL database to store the information.
All require the ban flag
sm_ptt_add <Client Name>
: Adds a client to the database to be tracked
sm_ptt_delete <Client Name>
: Removes a client from the database.
sm_ptt_stop <Client Name>
: Stops tracking the client, but does not delete their time from the database
: Reverses the effect of sm_track_stop
sm_ptt_gettime <Client Name>
: Prints target's current time played (hh:mm:ss) into console.
: Prints your time into chat. (Alternatively, say !mytime
- plugin.ptt.cfg is auto-generated in cfg/sourcemod/ . Please edit that file to change these options.
- Start tracking as soon as client is added to database? (1=yes 0=no) default=1
- Track every player that ever connects to your server? (1=yes 0=no) default=0
- Enable tracking? (1=yes 0=no) default=1
- Time (in seconds) between data updates default= 5
- Database connection (in databases.cfg) to use. Default="default"
- Table in your SQL database to use. Default="TimeTracker"
- Good for keeping separate servers separate!
- Shows plugin version
- Which players to track: 1=all, 2=only those on a team (no spectators/unassigned) Default=1
1) Run this SQL command on your database:
CREATE TABLE `TimeTracker` (
`name` varchar(64) NOT NULL,
`steamid` varchar(64) NOT NULL,
`TimePlayed` int(64) NOT NULL,
`tracking` tinyint(1) NOT NULL,
UNIQUE KEY `steamid` (`steamid`)
2) Download and place ptt.smx into your addons/sourcemod/plugins/ directory
3) Open cfg/sourcemod/plugin.ptt.cfg and edit to your needs
4) (Optional) Download ptt webui.zip, upload contents to webserver, change settings in ptt.mysql.inc.php
--By default, this uses your "default" SQL server. Make sure you have it set up in configs/databases.cfg. You can change the database connection to use with "sm_ptt_database"
--Please note as of now, if you want to add or remove a track, or check someone's time, they need to be in the same server you are in. A future addition to this plugin will allow you to remove or check times when they are not in the server. Adding tracks will be added too, but you will need to know their Steam ID.
Web UI Changelog:
2.3.5 UNTESTED! :D
- Added sm_ptt_team
- Fixed bug blocking tracking of bots
- Removed some redundant code
- Fixed error log spam
- Fixed bug related to Bots
- Added FCVAR_DONTRECORD to version cvar
- Fixed another bug with sm_ptt_automatic not working well
- ptt.txt is no longer needed. Feel free to delete!
- Fixed long standing issue with names with single quotes in them
- Removed OnClientDisconnect added in 2.2 as it is no longer needed
- Fixed a bug that broke sm_ptt_automatic
- Times are no longer updated on disconnect
- sm_ptt_refresh minimum changed to 1.0, maximum changed to 10.0
- OnClientPostAdminCheck now OnClientAuthorized
- Steam IDs are checked on map change to prevent SQL errors when sm_ptt_automatic is on.
- Steam ID stored to a client is cleared when they disconnect to prevent bugs
- Changed how times are updated using decaprime's suggestion (Occam's razor-esque solution!)
- When a player's time is updated, it adds updateinterval to his current time, instead of calulating that same number using too much logic (D'oh!)
- When a player is added to the tracker, his current gametime is added.
- Bug fixes
- Auto config added
- Added sm_ptt_table
- Added sm_ptt_database
- Fixed a MAJOR bug that I stupidly created
- Changed how times are updated on intervals. Negative times should be a thing of the past (hopefully)!
- Attemps to stop recording time for people who are timing out
- Some special characters in names will show up correctly now
- Names are now updated when times are updated
- Added another check to prevent corrupt times
- Userids are now stored in a data file, so in-place upgrades will not be a problem anymore.
- Changed logic for determining if cilent is connecting new, or if they are just changing maps
- Bug fixes
- Added logic to make sure that a client's time won't be updated on the update interval if they disconnected during the interval
- Fixed lag when updating times on interval by switching to threaed SQL queries (which took way too long! :P)
- Refresh time is now updated as soon as sm_ptt_refresh is changed
- Bug fixes
- Fixed bug where times would be overwritten if clients didn't disconnect gracefully
- Added sm_ptt_refresh
- Times are now updated every x seconds, where x is the value of sm_ptt_refresh, as well as on disconnect.
- SQL table updated. Plugin will warn you if you are missing the addition, and will not update times on the sm_ptt_refresh interval
- Renamed all cvars/commands from sm_track to sm_ptt
- Added sm_track_version convar
- Simple Web UI!
- Added responses to more admin commands
- Removed player_activate event handler, added OnClientAuthorized
- Added sm_track_enabled
- Added sm_mytime
- Bug fixes
- Changed plugin file name to ptt
- More bug fixes! :D
- Added sm_track_automatic
- Bug fixes
- Misc. bug fixes
- Fixed invalid client index error spamming error logs
- Removed time update on death
- Fixed default track action not working
- sm_track_add/delete now deals with creating and removing rows in the database
- sm_track_start/stop does not add/remove any rows, just enables or disables
tracking on a player without interfering with the recorded time
- added Cvar sm_track_default_action
- Time is now updated on death and disconnect
- Fixed two errors being thrown too much
- Changed sm_track_add to sm_track_start
- Changed sm_track_remove to sm_track_delete
- Fixed bug calculating seconds
- Fixed formatting of time display
- Initial Release
README BEFORE UPGRADING
Disregard if you are upgrading FROM v2.1 or later
- Added support in mysql config file for different table names
- Fixed encoding of some characters
- Increased width of table
- Added sorting
- Initial Release
Due to the way the plugin is structured (to prevent invalid times), you should only upgrade this plugin when you server is EMPTY!
Let me repeat:
If you want to upgrade this plugin, YOUR SERVER SHOULD BE EMPTY!
Make sure you change the map/restart your server as soon as you put the updated version on, or TIMES WILL BE WRONG!
Please run this command on your SQL Database, or you will get problems with SQL queries
ALTER TABLE `TimeTracker` DROP `StoredTime`;
If you are upgrading from version 2.2 or earlier:
Please delete cfg/sourcemod/plugin.ptt.cfg before upgrading to allow a new config file to be generated. Then change it with your preferences.