AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Auto Restart /top15 for month (https://forums.alliedmods.net/showthread.php?t=346196)

bakugan 02-13-2024 13:48

Auto Restart /top15 for month
 
Delete please

quil 02-14-2024 16:52

Re: Auto Restart /top15 for month
 
use set task plugin

bigdaddy424 02-14-2024 18:15

Re: Auto Restart /top15 for month
 
cron job

bakugan 02-17-2024 12:11

Re: Auto Restart /top15 for month
 
Quote:

Originally Posted by quil (Post 2818049)
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."

mlibre 02-17-2024 12:23

Re: Auto Restart /top15 for month
 
@bakugan are we talking about restarting the entire top, starting from scratch?

bakugan 02-17-2024 17:36

Re: Auto Restart /top15 for month
 
Quote:

Originally Posted by mlibre (Post 2818169)
@bakugan are we talking about restarting the entire top, starting from scratch?



I need the plugin for monthly restart.

mlibre 02-17-2024 20:35

Re: Auto Restart /top15 for month
 
ok but the statistics will remain at zero, everything, not just the current month, doesn't it matter?

bakugan 02-22-2024 06:30

Re: Auto Restart /top15 for month
 
Quote:

Originally Posted by mlibre (Post 2818183)
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?

mlibre 02-23-2024 10:49

Re: Auto Restart /top15 for month
 
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



Bugsy 02-23-2024 13:39

Re: Auto Restart /top15 for month
 
Why not just execute "csstats_reset 1" ?


All times are GMT -4. The time now is 16:29.

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