Need help getting debug monitor restart timer to match actual restart schedule.

NighthawkXL

New Member
I've been wracking my brain over the last few hours trying to fix our server's debug monitor restart counter...

Here's the code I'm using...
Code:
waitUntil {alive player};
 
while {true} do
{
    _kills =        player getVariable["zombieKills",0];
    _killsH =        player getVariable["humanKills",0];
    _killsB =        player getVariable["banditKills",0];
    _humanity =        player getVariable["humanity",0];
   
    hintSilent parseText format ["
    <t size='0.95' font='Bitstream'align='center' color='#D60000'>-={SE}=- DayZ</t><br/>
    <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %2 Days</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
    <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %10 Minutes</t><br/>",
 
    dayz_playerName,(dayz_Survived),(count playableUnits),_killsH,_killsB,_kills,round _humanity,r_player_blood,(round diag_fps),(round(240-(serverTime) / 60))
    ];
sleep 1;
};

The server restarts every 4 hours starting at 12:00 AM what do I need to set
Code:
(round(240-(serverTime) / 60))
to get it to sync up? I'm restarting via TCAdmin's scheduler, the server is UTC-8:00 but I don't know what time zone HFBServer's admin panel is using.
 
well i know ths is old but im gonna answer it for anyone else who is stuck on this
Code:
waitUntil {alive player};
 
while {true} do
{
    _kills =        player getVariable["zombieKills",0];
    _killsH =       player getVariable["humanKills",0];
    _killsB =       player getVariable["banditKills",0];
    _humanity =     player getVariable["humanity",0];
    _stime = servertime;
    _HoursTillRestart = 4//how many hours between restarts
    _serverRestart = _HoursTillRestart - 1;
    _hours = (_stime/60/60);
    _hours = toArray (str _hours);
    _hours resize 1;
    _hours = toString _hours;
    _hours = compile _hours;
    _hours = call  _hours;
    _minutes = round(_stime/60);
    _minutes = _minutes - (_hours*60);
    _hours = _serverRestart - _hours;
    _minutes = 60 - _minutes;
   
    hintSilent parseText format ["
    <t size='0.95' font='Bitstream'align='center' color='#D60000'>-={SE}=- DayZ</t><br/>
    <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %2 Days</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
    <t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %10 Hours %11 Minutes</t><br/>",
 
    dayz_playerName,(dayz_Survived),(count playableUnits),_killsH,_killsB,_kills,round _humanity,r_player_blood,(round diag_fps),_hours,_minutes
    ];
sleep 1;
};
thats how i would do it
 
@Bushwookie420 you missed something here:
PHP:
    _HoursTillRestart = 4//how many hours between restarts
should be:
PHP:
    _HoursTillRestart = 4; //how many hours between restarts
besides that ... damn that was a lot of code to do almost the same as:

PHP:
(240-(round(serverTime/60)))
lol :p
however if you got timed restart at certain times of the day, then it will not be syncronized before the next scheduled restart and if you restart the server in between sceduled restarts it will be unsynced again.
 
I got a question for this, i got the time in my server i've set it to 239 so it shows 0 on the last min, how do i make it count down seconds when it's on it's last min?

like this
Code:
if(239-(round(servertime/60)) == 0)
right here is where it starts counting the seconds when it's less then a min remaning.
 
Code:
if ((239-(round(servertime/60)) == 0) then {
    (14400-(servertime))
};

I think that's correct.

The original code is taking the servertime in seconds and dividing it to get minutes, making sure its round, and then subtracting it from the minutes you have set for your restarts.
So I took your minutes, multiplied it to seconds, then added 60 seconds for the final minute.
The math should be correct, but I don't know the debug will be able to read it like that out of an if statement. I think it may need to be like this:

Code:
if ((239-(round(servertime/60)) == 0) then {
    (14400-(servertime))
} else {
    (239-(round(servertime/60)))
};
 
I think you would replace
(239-(round(servertime/60)))

With the whole block of code I posted.
 
That would work? i didn't know that. I'm gonna try that right now. I would assum it needs to be at the bottom of the script due to the ","
 
Back
Top