Quote:
Originally Posted by watch
If anyone can think of a better way they hooking it off changelevel im all ears. Doing it when the plugin is initialised wouldn't work unless tasks were used and theres always the possiblity that people get redirected to a http download if they don't have the map. Also with disconnect i thought would be poor as everyone disconnects when the server changes level, not really ideal. I might be being stupid and missed another method thats blatently obvious though I considered using a task but it seemed a bit silly just for this
|
Good job mate!
Actually I have made a plugin like that, that restarts my server at 4:44 at a daily basis (I can't seem to find it however I posted it here on the forum... ). I don't need to check the number of player because at 4:44 my server is always empty
Why not just create a task for checking every minute? That is not silly. Running the taskcode is infinite small time compared to the total server running time. Especially if the work done in the task is not so complex, like checking if the total player number == 0 then do a restart ... You could set a task every minute or 5 minutes just to do that without a noticable performance penalty.
You could make it so that it sets a task every hour, except between 0:00 and 6:00 (24-hour) it checks every 5 minutes . You don't have to hook any other routine.
__________________