SnipeZz_Qc
Member
Current Version: 0.1
Last Update: 27/04/13
Automatic Message
Here it is !
Code:
private ["_mainTextColour","_subTextColour","_hint"];
diag_log(format ["DEBUG RESTART MESSAGE || inizializing || %1",round(time)]);
_subTextColour = "#FF0000";
_mainTextColour = "#4BC9B0";
//1 hour before
waituntil {(round(time)) > 10799};
diag_log(format ["DEBUG RESTART MESSAGE || waituntil || %1",round(time)]);
if (time > 10799) then {
diag_log(format ["DEBUG RESTART MESSAGE||inside if2 no round|| %1",time]);
_hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Server Reboot</t><br/><t align='center' color='%2'>---------------------------------</t><br/><t color='%3' size='1.0'>In 1 Hour</t>", _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;
};
//30 mins before
waituntil {(round(time)) > 12599};
diag_log(format ["DEBUG RESTART MESSAGE || waituntil || %1",round(time)]);
if (time > 12599) then {
diag_log(format ["DEBUG RESTART MESSAGE||inside if2 no round|| %1",time]);
_hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Server Reboot</t><br/><t align='center' color='%2'>---------------------------------</t><br/><t color='%3' size='1.0'>In 30 Mins</t>", _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;
};
//5 mins before
waituntil {(round(time)) > 14099};
diag_log(format ["DEBUG RESTART MESSAGE || waituntil || %1",round(time)]);
if (time > 14099) then {
diag_log(format ["DEBUG RESTART MESSAGE||inside if2 no round|| %1",time]);
_hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Server Reboot</t><br/><t align='center' color='%2'>---------------------------------</t><br/><t color='%3' size='1.0'>In 5 Mins</t>", _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;
};
//1 min before
waituntil {(round(time)) > 14339};
diag_log(format ["DEBUG RESTART MESSAGE || waituntil || %1",round(time)]);
if (time > 14339) then {
diag_log(format ["DEBUG RESTART MESSAGE||inside if2 no round|| %1",time]);
_hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Server Reboot</t><br/><t align='center' color='%2'>---------------------------------</t><br/><t color='%3' size='1.0'>In 1 Min</t>", _mainTextColour, _subTextColour];
[nil,nil,rHINT,_hint] call RE;
};
And add _message_reboot = [] execVM "message_reboot.sqf"; In isServer { (init in MpMission serverside)
And Remember to name the script message_reboot.sqf in the MpMission (serverside)
If you guys want to edit the time for the msg (now its config for a restart each 4 hours) the the time is in second.
Thanks to mmmyum for is help
SniPeZz_Qc