AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] adminWatch (v1.2.2) (https://forums.alliedmods.net/showthread.php?t=217670)

pat841 06-05-2013 18:35

[ANY] adminWatch (v1.2.2)
 
2 Attachment(s)
adminWatch v1.2.2


Description:
I have been developing small little plugins for my community and I thought I should share this one. Modify how you would like, just please give credit when necessary. What this plugin does is for a certain admin flag, it tracks and stores the total minutes an admin is connected to the server and the total time played (non-spec) in the database. This can be useful for many reasons such as in my case I like to track how active my admins in my servers. I will be requesting suggestions and I will update this plugin when needed, so any suggestions are more than welcome.

Features:
  • Keep track of admin idle time
  • Keep track of admin play time
  • Keep track of admin commands
  • Clean web interface
  • MySQL Database Storage

Cvars:
PHP Code:

sm_adminwatch_version // Prints the plugin version
sm_adminwatch_enabled <1/0// Enables or disables the plugin
sm_adminwatch_logging <1/0// Enables logging admin commands in database
sm_adminwatch_adminflag <1/FLAGS// 1 - All Admins, FLAGS = Flags to use such as "z" being root
sm_adminwatch_precision <0/1// 0 - Store time in seconds, 1 - Store time in minutes 

Install:
  1. Download the latest version of adminwatch.smx.
  2. Upload the plugin to your sourcemod/plugins/ directory.
  3. Add a database listing in /sourcemod/configs/databases.cfg with "adminwatch" (Example Below).
  4. Restart your server or use "sm plugins load adminwatch" in rcon.
  5. Edit the config in /cfg/sourcemod/adminwatch.cfg.
  6. If using the web script, edit databases.include.php with your database settings.
  7. Voila! You're good to go.
  8. OPTIONAL: Install the Updater plugin HERE to auto-update this plugin.

Databases.cfg Example:
Code:

        "adminwatch"
        {
                "driver"                        "default"
                "host"                                "localhost"
                "database"                        "database"
                "user"                                "username"
                "pass"                                "password"
                //"timeout"                        "0"
                //"port"                        "0"
        }

Bugs:
  • None

ToDo:
  • Display admin stats to root using in-game menu.

Version Log:
Spoiler

pat841 06-06-2013 16:31

Re: [ANY] adminWatch (v1.0.2)
 
RESERVED.

Note: Those who downloaded the earlier web script, I fixed an issue when converting from seconds to H:M:S which has now been re-uploaded.

DoPe^ 06-07-2013 06:22

Re: [ANY] adminWatch (v1.0.2)
 
NOTICE
For people having issue with the plugin, check out my post here
https://forums.alliedmods.net/showpo...&postcount=112

time to spy on my admins! :D thanks for this.

any chance you could add the admin names also to the database? and on the webpage.
Since I can't remeber which steamid belongs to who in my head :D


edit:
And also something that could be awesome, the last time the admin connected to the server.
And maybe also how many connections he have made.
Aaaand something there would probly take some time to make, but something like weekly stats also.

pat841 06-07-2013 15:25

Re: [ANY] adminWatch (v1.0.2)
 
Quote:

Originally Posted by DoPe^ (Post 1966097)
time to spy on my admins! :D thanks for this.

any chance you could add the admin names also to the database? and on the webpage.
Since I can't remeber which steamid belongs to who in my head :D


edit:
And also something that could be awesome, the last time the admin connected to the server.
And maybe also how many connections he have made.
Aaaand something there would probly take some time to make, but something like weekly stats also.

Updated the plugin with your suggestions. Thanks.

DoPe^ 06-07-2013 15:52

Re: [ANY] adminWatch (v1.0.2)
 
Quote:

Originally Posted by pat841 (Post 1966318)
Updated the plugin with your suggestions. Thanks.

awesome :) thank you! will I need to run something on the SQL part?

pat841 06-07-2013 15:54

Re: [ANY] adminWatch (v1.0.2)
 
Quote:

Originally Posted by DoPe^ (Post 1966332)
awesome :) thank you! will I need to run something on the SQL part?

You can either drop the existing tables and have the plugin re-create the table or update the schema yourself. Here is the schema:

PHP Code:

CREATE TABLE `adminwatch` (
    `
idINT(10NOT NULL AUTO_INCREMENT,
    `
steamVARCHAR(50NOT NULL,
    `
nameVARCHAR(50NOT NULL,
    `
totalINT(11NOT NULL DEFAULT '0',
    `
playedINT(11NOT NULL DEFAULT '0',
    `
last_playedVARCHAR(50NOT NULL,
    
PRIMARY KEY (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM 


DoPe^ 06-07-2013 16:09

Re: [ANY] adminWatch (v1.0.3)
 
thanks :) i'll test it out

cREANy0 06-07-2013 19:36

Re: [ANY] adminWatch (v1.0.3)
 
Would it be possible to add a Week/Month statistic?

ocwoody 06-07-2013 19:54

Re: [ANY] adminWatch (v1.0.3)
 
Admin logging would be a great feature. There is currently only one working admin logging plugin (http://forums.alliedmods.net/showthread.php?t=60471), but it doesn't support mysql, nor does it have a web interface.

I'm already using this for my community, but would love to see the above added!

DoPe^ 06-08-2013 07:55

Re: [ANY] adminWatch (v1.0.3)
 
hmm im getting this Warning on the webpage

Code:

Warning: date() expects parameter 2 to be long, string given in /home/clanroy2/public_html/adminwatch/index.php on line 29


All times are GMT -4. The time now is 13:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.