Alex_Jemison
Умник
Попросили меня переделать с одной тексдрава на 2 работу я выполнил , но теперь интересует как это оптимизировать
PHP:
new Text: DateAndClock[2];
DateAndClock[0] = TextDrawCreate(554.6668, 4.5777, "15:40");
TextDrawLetterSize(DateAndClock[0], 0.4239, 2.1309);
TextDrawAlignment(DateAndClock[0], 1);
TextDrawColor(DateAndClock[0], -253326081);
TextDrawSetOutline(DateAndClock[0], 1);
TextDrawBackgroundColor(DateAndClock[0], 255);
TextDrawFont(DateAndClock[0], 3);
TextDrawSetProportional(DateAndClock[0], 1);
TextDrawSetShadow(DateAndClock[0], 0);
DateAndClock[1] = TextDrawCreate(575.3331, 22.8295, "31TH_Monday");
TextDrawLetterSize(DateAndClock[1], 0.1983, 1.0980);
TextDrawAlignment(DateAndClock[1], 2);
TextDrawColor(DateAndClock[1], -253326081);
TextDrawSetOutline(DateAndClock[1], 1);
TextDrawBackgroundColor(DateAndClock[1], 255);
TextDrawFont(DateAndClock[1], 2);
TextDrawSetProportional(DateAndClock[1], 1);
TextDrawSetShadow(DateAndClock[1], 0);
UpdateTimers(playerid);
SetTimer("UpdateTimers",1000*60,true);
forward UpdateTimers(playerid);
public UpdateTimers(playerid)
{
new var1[2], var2[2], var3[2];
new str[40];
new string[40];
getdate(var1[0], var2[0], var3[0]);
gettime(var1[1], var2[1]);
new const DayNames[][] = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };
new year = var3[0], month = var2[0], day = var1[0];
if(month < 3) month += 12, day--;
format(str, 40, "%02d:%02d", var1[1], var2[1]);
format(string, 40, "%02dTH_%s", var3[0], vDayNames[((13 * month + 3) / 5 + year + day + day / 4 - day / 100 + day / 400) % 7]);
TextDrawSetString(DateAndClock[0], str);
TextDrawSetString(DateAndClock[1], string);
TextDrawShowForPlayer(playerid, DateAndClock[0]);
TextDrawShowForPlayer(playerid, DateAndClock[1]);
return true;
}
