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

Reload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Azerja12
Senior Member
Join Date: Feb 2013
Location: EU
Old 03-26-2015 , 11:47   Reload
Reply With Quote #1

Any way to make a automatic reload plugin that will reload plugins on a timer? Like every 6 hours it reloads all plugins like sm plugins reload.

I was thinking about a plugin that will prevent the server from crashing. This was one of the smalling things i think would work nicely with it.

Even automatic server restart on timer.
__________________

Last edited by Azerja12; 03-26-2015 at 12:00.
Azerja12 is offline
Azerja12
Senior Member
Join Date: Feb 2013
Location: EU
Old 03-27-2015 , 06:14   Re: Reload
Reply With Quote #2

Is there anything out there like this?
__________________
Azerja12 is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 03-28-2015 , 11:19   Re: Reload
Reply With Quote #3

Plugins automatically reload on map changes, but if you're running the same map constantly then this can help. You can change the value of HOURS if you want.

Spoiler
thecount is offline
Azerja12
Senior Member
Join Date: Feb 2013
Location: EU
Old 03-28-2015 , 13:18   Re: Reload
Reply With Quote #4

Quote:
Originally Posted by thecount View Post
Plugins automatically reload on map changes, but if you're running the same map constantly then this can help. You can change the value of HOURS if you want.

Spoiler
How about server restart?
__________________
Azerja12 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-28-2015 , 14:09   Re: Reload
Reply With Quote #5

change
PHP Code:
ServerCommand("sm plugins refresh"); 
to
PHP Code:
ServerCommand("_restart"); 
__________________
Want to check my plugins ?
Arkarr is offline
Azerja12
Senior Member
Join Date: Feb 2013
Location: EU
Old 03-28-2015 , 16:05   Re: Reload
Reply With Quote #6

So to have my server restart automatically every 12hrs i need to paste it here?:
https://www.sourcemod.net/compiler.php

Quote:
#include <sourcemod>

#define HOURS 6

new minutes = 0;

public OnPluginStart(){
CreateTimer(60.0, AddMinute, _, (TIMER_FLAG_NO_MAPCHANGE|TIMER_REPEAT));
minutes = 0;
}

public Action:AddMinute(Handle:timer){
minutes++;
if(minutes == (HOURS * 12)){
ServerCommand("_restart");
minutes = 0;
}
return Plugin_Continue;
}
I have no plugin experience!
__________________

Last edited by Azerja12; 03-28-2015 at 16:06.
Azerja12 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-28-2015 , 16:06   Re: Reload
Reply With Quote #7

Quote:
Originally Posted by Azerja12 View Post
So to have my server restart automatically every 12hrs i need to paste it here?:
https://www.sourcemod.net/compiler.php



I have no plugin experience!
Why don't you go a head and try it out ?
__________________
Want to check my plugins ?
Arkarr is offline
Azerja12
Senior Member
Join Date: Feb 2013
Location: EU
Old 03-28-2015 , 16:07   Re: Reload
Reply With Quote #8

Quote:
Originally Posted by Arkarr View Post
Why don't you go a head and try it out ?
Does it look right?

To test it i'll have to wait 12hrs :<
__________________
Azerja12 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 03-28-2015 , 16:21   Re: Reload
Reply With Quote #9

Quote:
Originally Posted by Azerja12 View Post
Does it look right?

To test it i'll have to wait 12hrs :<
definitly OK.
__________________
Want to check my plugins ?
Arkarr is offline
thecount
Veteran Member
Join Date: Jul 2013
Old 03-28-2015 , 16:48   Re: Reload
Reply With Quote #10

No you multiplied the HOURS by 12 instead of changing the value. This is the right way.

Spoiler
thecount 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 09:08.


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