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

Auto Restart /top15 for month


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 02-13-2024 , 13:48   Auto Restart /top15 for month
Reply With Quote #1

Delete please
__________________
WebSite

Last edited by bakugan; 04-04-2024 at 12:30. Reason: Delete please
bakugan is offline
quil
Junior Member
Join Date: Dec 2023
Old 02-14-2024 , 16:52   Re: Auto Restart /top15 for month
Reply With Quote #2

use set task plugin
quil is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 02-14-2024 , 18:15   Re: Auto Restart /top15 for month
Reply With Quote #3

cron job
__________________
bigdaddy424 is offline
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 02-17-2024 , 12:11   Re: Auto Restart /top15 for month
Reply With Quote #4

Quote:
Originally Posted by quil View Post
use set task plugin
"I don't know which plugin is being used; let's make this plugin automatically restart, used for CS 1.6. It should restart /top15 automatically every month."
__________________
WebSite
bakugan is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 02-17-2024 , 12:23   Re: Auto Restart /top15 for month
Reply With Quote #5

@bakugan are we talking about restarting the entire top, starting from scratch?
__________________
mlibre is offline
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 02-17-2024 , 17:36   Re: Auto Restart /top15 for month
Reply With Quote #6

Quote:
Originally Posted by mlibre View Post
@bakugan are we talking about restarting the entire top, starting from scratch?


I need the plugin for monthly restart.
__________________
WebSite
bakugan is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 02-17-2024 , 20:35   Re: Auto Restart /top15 for month
Reply With Quote #7

ok but the statistics will remain at zero, everything, not just the current month, doesn't it matter?
__________________
mlibre is offline
bakugan
Member
Join Date: Dec 2023
Location: Bulgaria
Old 02-22-2024 , 06:30   Re: Auto Restart /top15 for month
Reply With Quote #8

Quote:
Originally Posted by mlibre View Post
ok but the statistics will remain at zero, everything, not just the current month, doesn't it matter?
I couldn't understand what you were saying at all. Do I need a plugin to be created or is there even such a plugin?
__________________
WebSite
bakugan is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 02-23-2024 , 10:49   Re: Auto Restart /top15 for month
Reply With Quote #9

proof

PHP Code:
#include <amxmodx>

#define PLUGIN "autoResetStats"
#define VERSION "1.2a"
#define AUTHOR "mlibre"

new const cvar_csx[] = "csstats_reset"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_cvar(PLUGINVERSIONFCVAR_SERVER FCVAR_SPONLY)
}

public 
plugin_cfg()
{
    if(
cvar_exists(cvar_csx))
    {
        
autoResetStats()
    }
    else
    {
        
server_print("[%s] The csx module is not loaded!"PLUGIN)
    }
}

autoResetStats()
{
    
set_cvar_num(cvar_csx0)
    
    
server_print("[%s] Checking day!"PLUGIN)
    
    new 
getDay[3]; get_time("%d"getDaycharsmax(getDay))
    
    if(
equal(getDay"01")) //<-every first day of the month
    
{
        if(
chk(PLUGIN))
        {
            
server_print("[%s] The statistics have already been reset this month!"PLUGIN)
            
            return
        }
        
        
set_cvar_num(cvar_csx1)
        
        
server_print("[%s] Statistics have been reset!"PLUGIN)
        
        new 
fp fopen(PLUGIN"w"); fclose(fp)
    }
    else
    {
        
server_print("[%s] It's not time!"PLUGIN)
        
        if(
chk(PLUGIN))
        {
            
delete_file(PLUGIN)
        }
    }
}

stock chk(file[])
{
    if(
file_exists(file))
    {
        return 
1
    
}
    
    return 
0

__________________

Last edited by mlibre; 02-23-2024 at 12:27. Reason: upd v1.2a
mlibre is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-23-2024 , 13:39   Re: Auto Restart /top15 for month
Reply With Quote #10

Why not just execute "csstats_reset 1" ?
__________________
Bugsy 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 08:38.


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