Raised This Month: $51 Target: $400
 12% 

Stats Auto Reset


Post New Thread Reply   
 
Thread Tools Display Modes
Leo_BH
Junior Member
Join Date: Dec 2014
Location: Ukraine
Old 08-13-2016 , 14:17   Re: Stats Auto Reset
Reply With Quote #11

Quote:
Originally Posted by siriusmd99 View Post
You could also add cvar to control date of reset .
For example I want every month 15th day not first.
PHP Code:
    if(day == 1
It's simple to replace
__________________

Last edited by Leo_BH; 08-13-2016 at 14:20.
Leo_BH is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-13-2016 , 14:52   Re: Stats Auto Reset
Reply With Quote #12

Quote:
Originally Posted by Leo_BH View Post
PHP Code:
    if(day == 1
It's simple to replace
For someone that does not know how to code, it's not. You should really add cvars for everything that people can or should change.
__________________
HamletEagle is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 08-13-2016 , 19:38   Re: Stats Auto Reset
Reply With Quote #13

Quote:
Originally Posted by EFFx View Post
3. Add a log adding the current day, example:
PHP Code:
log_amx("The stats has been reseted today: 08/12/2016"
This is not necessary because the time stamp is already putted by 'log_amx' and 'log_to_file'.

Quote:
Originally Posted by EFFx View Post
1. A cvar for add if the owner/admin want to the plugin reset all status after one month, two months, 1 week, 2 week, will not be bad.
My suggestions:
  1. Can be created one cvar, which is parsed to read the settings on plugin_cfg().
    Code:
    auto_stats_reset "d, 5, 20, log_file_name"
    The first is to choose between daily reset 'd', weekly reset 'w', month reset 'm', and yearly reset 'y'.
    The second is the hour of day/day of week/day of month/day of the year, accordingly the the first one.
    The third is the minute of the day/hour of the day, accordingly the the second one.
    The forth one, if '0' to choose log to the current server log "log_amx" or 'log_file_name' to a dedicated log file by "log_to_file".

  2. An aggressive mode by config by the cvar "auto_stats_reset_mode" which can let the user to choose between the options:
    0. Let it as it currently is: Make sure that you have going on at least one map-change.
    1. Hook the event round start or end, to check if it is time to reset.
    2. The same as 2, but restart the server immediately to clean the status.

  3. Fix this:
    Code:
        if(day == 1)     {         if(hour < 6)         {
    You are continually resetting the status between midnight and 6 am, and also, if the server is not restarted during that period, it will not work.
    Make it work only one time. When is the right time to reset the server, accordingly to the cvar "auto_stats_reset_mode".
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective

Last edited by addons_zz; 08-13-2016 at 19:40. Reason: misspelling
addons_zz is offline
smiley92
Senior Member
Join Date: Jun 2011
Location: Romania
Old 12-12-2017 , 03:19   Re: Stats Auto Reset
Reply With Quote #14

After reset stats don't must to set cvar "csstats_reset" to 0?
smiley92 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-12-2017 , 07:50   Re: Stats Auto Reset
Reply With Quote #15

Just delete the csstats.dat file and it will erase everything.
__________________
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:36.


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