01.12.2012, 12:52
Gettime - Get the current server time, which will be stored in the variables &hour, &minute and &second.
Guess what? There is a format of %02d and if it's under 10, let's say 9, it uses 09. It's not need to use if/else for 0 or null.
pawn Код:
public settime(playerid)
{
new string[256],year,month,day,hours,minutes,seconds;
getdate(year, month, day), gettime(hours, minutes, seconds);
format(string, sizeof string, "%d/%02d%02d", day, month, year);
TextDrawSetString(Date, string);
format(string, sizeof string, "%02d:%02d:%02d", hours-2, minutes, seconds);
TextDrawSetString(Time, string);
}