Raised This Month: $32 Target: $400
 8% 

1337 Restarter


Post New Thread Reply   
 
Thread Tools Display Modes
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 12-03-2006 , 20:58   Re: Server Restart (every hour) [New Update v2.1]
Reply With Quote #31

You do not have to change the map, but I suggest it from personal experience..
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
bloody
Member
Join Date: Dec 2006
Old 12-03-2006 , 22:20   Re: Server Restart (every hour) [New Update v2.1]
Reply With Quote #32

ok thank you ima just change the map every week and have this plugin on thank you for the help banana and imanoobie
bloody is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 12-04-2006 , 03:03   Re: Server Restart (every hour) [New Update v2.1]
Reply With Quote #33

Code:
server_cmd("exec server.cfg")
not realy needed the server reloads it by it self
k007 is offline
Send a message via MSN to k007
godlike
Senior Member
Join Date: Apr 2005
Old 12-04-2006 , 10:01   Re: Server Restart (every hour) [New Update v2.1]
Reply With Quote #34

make a cvar so we can make it restart every 2hours or 3 ....
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
bloody
Member
Join Date: Dec 2006
Old 12-04-2006 , 16:50   Re: Server Restart (every hour) [v2.1b]
Reply With Quote #35

yes may you do that
bloody is offline
blade12
BANNED
Join Date: Oct 2006
Old 12-05-2006 , 04:50   Re: Server Restart (every hour) [v2.1b]
Reply With Quote #36

u should have it for like 24 hours or 18 hours restart just helping new peaple to script

PHP Code:
/*
*    Server Restart (Every hour)
*
*    Description:
*    A small plugin which restarts the server every hour for
*    updates etc.
*
*    Credits:
*    jim_yang (helped me with the HUD message countdown)
*    
*    Changelog:
*    v2.1
*    -Changed the code a bit since the if(hour==0 && minute==0 && second==0) didn't work.
*    -Countdown now is in hour:minute:second mode
*    -Sorry for any inconvenience troubling the many updates today. Works fine now.
*
*    v2.0
*    -Added HUD Message countdown (Credits to jim_yang, The Specialist and Brad)
*    -Added cvar for HUD Message countdown
*    -Improved the code a little bit ;)
*    -Deleted the cvar to change the restart time
*
*    v1.2
*    -Added so the server.cfg will be executed every time it restarts by the plugin
*
*    v1.1
*    -Changed the cvars to pcvars
*
*    This plugin is provided as is (no warranties).
*    Copyright (C) 2006 MaTTe
*/

#include <amxmodx>
#include <amxmisc>
#define TIMER_TASK 123456
new g_Switchg_ShowTimer
new g_counter 3600
new hourminutesecond
public plugin_init() 
{
        
register_plugin("Server Restart","2.1b","MaTTe (mateo10)")
        
g_Switch register_cvar("server_restart""1")
        
g_ShowTimer register_cvar("server_showtimer""1")
        
        
set_task(1.0"CountDown"TIMER_TASK__"b")
        return 
PLUGIN_CONTINUE
}
public 
CountDown()
{
        if(
g_counter==0)
        {
                
restartServer()
                return
        }
        
g_counter--
        if(!
get_pcvar_num(g_ShowTimer))
                return
        
hour g_counter 3600
        minute 
g_counter 3600 180  //<< the end bit is how much time 60 = 1 min 120 = 2 hours 3 hours 180
        
second g_counter 3600 180  //<< the end bit is how much time 60 = 1 min 120 = 2 hours 3 hours 180
        
set_hudmessage(01000, -1.00.3500.011.00.010.014)
        
//show_hudmessage(0, "%d Seconds Until Server Restart.", g_counter)
        
show_hudmessage(0,"%02d:%02d:%02d Left",hour,minute,second)
}
public 
restartServer() 
{
        if(
get_pcvar_num(g_Switch)==1)
        {
                
server_cmd("restart")
        }
        return 
PLUGIN_CONTINUE


Last edited by blade12; 12-05-2006 at 04:54.
blade12 is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-05-2006 , 12:44   Re: Server Restart (every hour) [v2.1b]
Reply With Quote #37

change this if you want it to make 2 hours

new g_counter = 3600 to new g_counter = 7200
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
Imanoobie
BANNED
Join Date: Sep 2006
Old 12-05-2006 , 12:46   Re: Server Restart (every hour) [v2.1b]
Reply With Quote #38

Well, if you want to change it to something else...

the numbers is in seconds...now you know ;)
Imanoobie is offline
watch
Senior Member
Join Date: Sep 2005
Old 12-07-2006 , 11:17   Re: Server Restart (every hour)
Reply With Quote #39

1) http://forums.alliedmods.net/showthr...light=schedule

2) Why not just make the cvar specify the actual time :/ Like in hours then just do some simple calculations for the set_task... which is expensive >.<

3) Option to delay the restart if players are on the server
__________________
Code:
#include <amusing_small_signiture>

Last edited by watch; 12-07-2006 at 11:21.
watch is offline
godlike
Senior Member
Join Date: Apr 2005
Old 12-07-2006 , 12:16   Re: 1337 Restarter [v2.2b]
Reply With Quote #40

aah thank you. cool name :p
__________________
Read the rules before posting something stupid: click here

Any questions about amxx PM me
godlike is offline
Reply


Thread Tools
Display Modes

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:17.


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