Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- File: fn_auto_restart.sqf
- by Kasztura for ArmaLife.pl
- Pobieranie daty systemowej.
- "real_date" callExtension "+"; rrrr,mm,dd,hh,mm,ss
- local date in Arma format; example: [2017,11,20,10,40,58,1,323,0]
- */
- _data = call compile ("real_date" callExtension "+");
- waituntil { !isnil "_data" };
- diag_log "-------------------------------------------------------------";
- diag_log format ["==> Data Systemowa = %1 <==",_data];
- diag_log "-------------------------------------------------------------";
- _godzina = _data select 3;
- _minuta = _data select 4;
- _sekunda = _data select 5;
- 0 spawn {
- private ["_godzina","_minuta","_sekunda"];
- while {true} do
- {
- _data = call compile ("real_date" callExtension "+");
- if (isNil "_data") then { waituntil { !isnil "_data" } };
- _godzina = _data select 3;
- _minuta = _data select 4;
- _sekunda = _data select 5;
- ZEGAR_SYS = [_godzina,_minuta,_sekunda];
- uisleep 1;
- };
- };
- 0 spawn {
- if (isNil "ZEGAR_SYS") then { waituntil { !isnil "ZEGAR_SYS" } };
- SRV_RESTART = false;
- publicvariable "SRV_RESTART";
- _passwd = "797jktOikni1Oeo6";
- while {true} do
- {
- if ((((ZEGAR_SYS select 0) == 5) || ((ZEGAR_SYS select 0) == 11) || ((ZEGAR_SYS select 0) == 17) || ((ZEGAR_SYS select 0) == 23)) && ((ZEGAR_SYS select 1) == 30) && ((ZEGAR_SYS select 2) == 0)) then
- {
- while { ((ZEGAR_SYS select 1) < 55) } do
- {
- _czas = ((ZEGAR_SYS select 1) - 55) * (-1);
- [format ["Zaćmienie nastąpi w ciagu %1 min...", _czas]] remoteexeccall ["systemChat", -2];
- // diag_log format ["Zaćmienie nastąpi w ciagu %1 min...", _czas];
- // diag_log format ["ZEGAR_SYS_6 = %1",ZEGAR_SYS];
- uisleep 60;
- };
- _passwd serverCommand "#lock";
- uisleep 1;
- ["Restart", FALSE, TRUE] remoteexeccall ["BIS_fnc_endMission", -2];
- SRV_RESTART = true;
- publicvariable "SRV_RESTART";
- };
- if ((((ZEGAR_SYS select 0) == 6) || ((ZEGAR_SYS select 0) == 12) || ((ZEGAR_SYS select 0) == 18) || ((ZEGAR_SYS select 0) == 0)) && ((ZEGAR_SYS select 1) == 0) && ((ZEGAR_SYS select 2) == 0)) then
- {
- diag_log format ["RESTART !!! GODZINA %1",(ZEGAR_SYS select 0)];
- uisleep 0.5;
- _passwd serverCommand "#shutdown"; //"#restartserver"
- };
- uisleep 1;
- };
- };
- /*
- 0 spawn {
- if (isNil "ZEGAR_SYS") then { waituntil { !isnil "ZEGAR_SYS" } };
- while {true} do
- {
- if ((ZEGAR_SYS select 2) == 0 ) then
- {
- diag_log format ["ZEGAR_SYS_Co_Minute = %1",ZEGAR_SYS];
- };
- if (((ZEGAR_SYS select 1) == 0) && ((ZEGAR_SYS select 2) == 0)) then
- {
- diag_log format ["ZEGAR_SYS_Co_Godzinę = %1",ZEGAR_SYS];
- };
- if (((ZEGAR_SYS select 0) == 0) && ((ZEGAR_SYS select 1) == 0) && ((ZEGAR_SYS select 2) == 0)) then
- {
- diag_log format ["ZEGAR_SYS_Co_24h = %1",ZEGAR_SYS];
- };
- uisleep 1;
- };
- };
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement