*DLL прикрепил внизу темы.
Private ["_restarts_hours", "_restarts_times", "_kick_times", "_debug_time", "_Real_Hours", "_Real_Minutes", "_Real_Seconds", "_time", "_minutesToRestart", "_hoursToRestart", "_msg", "_i"]; // Часы рестартов, от меньшего к большему, для отображения реального времени до рестарта в мониторе отладки _restarts_hours = [2, 6, 10, 14, 18, 22]; // Точное время рестартов, для выключения сервера _restarts_times = ["02:00:00", "06:00:00", "10:00:00", "14:00:00", "18:00:00", "22:00:00"]; // Время в которое необходимо кикнуть игроков с сервера _kick_times = ["01:59:45", "05:59:45", "09:59:45", "13:59:45", "17:59:45", "21:59:45"]; _debug_time = ""; while {true} do { _time = toArray ("ultima_kickall" callExtension "21"); _Real_Hours = parseNumber(toString[(_time select 0)] + toString[(_time select 1)]); _Real_Minutes = parseNumber(toString[(_time select 3)] + toString[(_time select 4)]); _Real_Seconds = parseNumber(toString[(_time select 6)] + toString[(_time select 7)]); if (_Real_Hours < 10) then {_time = "0" + str(_Real_Hours);} else {_time = str(_Real_Hours);}; if (_Real_Minutes < 10) then {_time = _time + ":0" + str(_Real_Minutes);} else {_time = _time + ":" + str(_Real_Minutes);}; if (_debug_time != _time) then { _debug_time = _time; if (_Real_Minutes != 0) then {_minutesToRestart = 60 - _Real_Minutes;} else {_minutesToRestart = 0;}; if (_minutesToRestart < 10) then {_minutesToRestart = "0" + str(_minutesToRestart)} else {_minutesToRestart = str(_minutesToRestart)}; _hoursToRestart = -1; { if (_x > _Real_Hours) exitWith {_hoursToRestart = (_x - _Real_Hours - 1);}; } forEach _restarts_hours; if (_hoursToRestart == -1) then {_hoursToRestart = (_restarts_hours select 0) + 23 - _Real_Hours;}; if (_Real_Minutes == 0) then {_hoursToRestart = _hoursToRestart + 1}; _hoursToRestart = "0" + str(_hoursToRestart); { if ( (isPlayer _x) && (alive _x) ) then {_x setVariable ["Ultima_Time", (_hoursToRestart + ":" + _minutesToRestart), true];}; } forEach playableUnits; }; if (_Real_Seconds < 10) then {_time = _time + ":0" + str(_Real_Seconds);} else {_time = _time + ":" + str(_Real_Seconds);}; { if (_time == _x) exitWith { // 0|IP|Port|RCon пароль|0|0 "ultima_kickall" callExtension "2|127.0.0.1|2302|RConPass|0|0"; }; } forEach _restarts_times; { if (_time == _x) exitWith { // 0|IP|Port|RCon пароль|1|Произвольная строка "ultima_kickall" callExtension "0|127.0.0.1|2302|RConPass|1|RESTART РЕСТАРТ"; }; } forEach _kick_times; uiSleep 0.5; };
В миссии, и в Ваших скриптах(например в дебаг мониторе инфистара) можно получать так:
_time_to_restart = player getVariable ['Ultima_Time', '00:00'];
Пример для миссии, в котором каждые 10 секунд в чат выводится время:
Private ['_time_to_restart']; while {true} do { _time_to_restart = player getVariable ['Ultima_Time', '00:00']; systemChat _time_to_restart; sleep 10; };