Cloud22

Accurate Restart Time Calculator

3 posts in this topic

Posted (edited)

As promised I'm releasing something i made a couple of weeks back that I found more effective then the "dll required" restart timers. Now, I won't be giving you a restart timer but I will show you how the code can be applied. Oh, and this requires extDB3 but can be modified for extDB2 I suppose or you might be able to use the original that comes with ExiLe.

Override "ExileServer_system_database_connect.sqf" and find

ExileServerStartTime = (parseSimpleArray ("extDB3" callExtension "9:LOCAL_TIME")) select 1;

then after this line add

publicVariable "ExileServerStartTime";

Save the file.

Now go to where your restart timer is configured. Add this somewhere before where it checks the hour-startHour or whatever.

_aOn = [0,3,6,9,12,15,18,21,24]; // Military Time
startHour = ExileServerStartTime select 3;
startMinute = ExileServerStartTime select 4;
startSecond = ExileServerStartTime select 5;
correcto = [];
{
	if(startHour < _x and startHour != 24) then
	{
		correcto pushBack _x;
	};
} forEach _aOn;

Now the correct amount of hours can be determined by

((correcto select 0) - startHour)

and wala! You have a fully working exact restart timer.

SO how the hell do you actually use this? Heres an ExAD example config that utilizes this.

And heres someone elses statusbar utilizing this.

https://github.com/Cloudhax23/Exile/blob/master/SomeStatusBar/fn_Statusbar.sqf#L10-L31

https://github.com/Cloudhax23/Exile/blob/master/SomeStatusBar/fn_Statusbar.sqf#L87

Edited by Cloud22
3 people like this

Share this post


Link to post
Share on other sites

This works perfectly!! :D Thank you, dude!!

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.