Description
A rank system based in the time played, this save CT, T and Spectator time played and show in rank.
This plugin can use a sqlite then you not need a mysql
Commands
Code:
sm_active - (!active) Show most active menu
sm_wasted - replays in chat: "[Most Active] Players wasted a total of %d hours %d minutes %d seconds on this server"
Also you can use !active command with a argument, like
!active STEAM_1:0:25671458 for search the time played in the server that have the user with the steamid "STEAM_1:0:25671458"
Cvars
Autogenerate config on first load into cfg/sourcemod/mostactive.cfg
Code:
sm_mostactive_logs "0" // Enable query logging for debug
sm_mostactive_prunetime "30" // Time on days for prune inactive users. 0 = never prune users.
You can test this plugin here:
http://www.gametracker.com/server_in....207.156:27015 /b_350_20_692108_381007_FFFFFF_000000.png" rel="nofollow noopener">
Natives for developers:
PHP Code:
/*********************************************************
* Called when a new player will be written to db
*
* @param client the new client that will be added
* @NoReturn
*********************************************************/
forward void MostActive_OnInsertNewPlayer(int client);
/*********************************************************
* Return the playtime of the client in a team
*
* @Return PlayTime as CT in seconds
*********************************************************/
native int MostActive_GetPlayTimeCT(int client);
/*********************************************************
* Return the playtime of the client in a team
*
* @Return PlayTime as T in seconds
*********************************************************/
native int MostActive_GetPlayTimeT(int client);
/*********************************************************
* Return the playtime of the client in a team
*
* @Return PlayTime as Spec in seconds
*********************************************************/
native int MostActive_GetPlayTimeSpec(int client);
/*********************************************************
* Return the playtime of the client in all teams
*
* @Return Total PlayTime as CT, T & Spec in seconds
*********************************************************/
native int MostActive_GetPlayTimeTotal(int client);
/*********************************************************
* Return the playtime of the client in all teams, except spectator
*
* @Return Total PlayTime as CT & T in seconds
*********************************************************/
native int MostActive_GetPlayTimeTotalExceptSpec(int client);
Install:
Put .smx file in addons/sourcemod/plugins
If you want to use
Mysql then go to addons/sourcemod/configs/databases.cfg
Copy and paste this code (edit with your Mysql data)
Code:
"mostactive" // dont edit
{
"driver" "mysql" // dont edit
"host" "YOUR HOST" // edit this
"database" "mostactive" // edit (optional)
"user" "YOUR USER" // edit this
"pass" "YOUR PASS" // edit this
//"timeout" "0"
"port" "YOUR PORT" // edit this
}
Or if you prefer
sqlite (local database) then use this code
Code:
"mostactive"
{
"driver" "sqlite"
"database" "mostactive"
}
Webpanel install:
Here the info.
Donations (optional):
If you apreciate my work, you can donate me via
paypal or with a
trade offer
Download:
Main repository
Direct download
Code changes
__________________