Quote:
Originally Posted by BACARRA
is it possible for it to work say at midnight every X days?
|
How it works is saves the last restart date in the vault, when the function is called, which is currently done on mapchange it checks if the currentdate and the saved last restart date match, if so it carrys on with the changelevel.
If the dates don't match it checks if there are any players on the server excluding bots, if there are no players restart (saving the last restart date), else carry on with the changelevel. This will repeat each changelevel until it has an opportunity to restart.
Wouldnt you rather your server restarted when it doesn't have players on, rather than when it does have players on?
If you really really wanted to do it on midnight you could see if your provider will do a cron job as that would probably be more efficient or theres probably a task scheduler plugin for amxx floating about somewhere.
Quote:
Originally Posted by Hawk552
What you could also do is hook client_disconnect, check if the time is overdue, and if it is and there's no one else on the server, restart it.
|
Yea i thought about that although when the map changes everyone is disconnected and the function would be run x howevery many people were on the server, i wasnt sure if that could possibly cause problems?
Ill test it and If its not an issue ill update it to disconnect
__________________