static const int
YEAR = 1577836800 - 4 * 3600, // 01.01.2020 с поправкой на часовой пояс
CLR[] = {6, 11, 15};
public Plugin myinfo =
{
name = "New Year Timeleft"
}
public void OnPluginStart()
{
CreateTimer(1.0, StartTimer_CallBack);
}
public Action StartTimer_CallBack(Handle timer)
{
PrintTimer();
CreateTimer(GetRandomFloat(300.0, 600.0), StartTimer_CallBack);
}
stock void PrintTimer()
{
int sec = YEAR - GetTime();
int clr = CLR[GetRandomInt(0, 2)];
if(sec > 0)
PrintToChatAll(" %c❄❅❄ \x01До Нового Года осталось: %c%d\x08\x01д %c%d\x08\x01ч %c%d\x08\x01м %c%02d\x08\x01сек", clr, clr, sec/3600/24, clr, sec/3600%24, clr, sec/60%60, clr, sec%60);
else PrintToChatAll(" %c❅❅❅ \x01С Новым Годом! %c❅❅❅", clr, clr);
}