How can i adjust the hour?
#7

Quote:
Originally Posted by sampmann
Посмотреть сообщение
I'm new at pawn and i dont know how to do it because i've never seen something like that
(hours < 10) ? ("0") : ("")

What does do "?" in the middle means?
It works like a check and return.

I made it myself.
pawn Код:
public clock()
{
    SyncTime();
    new string[256], year, month, day, hours, minutes, seconds;
    getdate(year, month, day), gettime(hours, minutes, seconds);
    new lhour = 19-hour;
    if(lhour) hour += 5;
    else day++, hour -= 19;
    format(string, sizeof string, "~b~~h~~h~~h~%d/%02d/%d", day, month , year);
    TextDrawSetString(clock1, string);
    format(string, sizeof string, "~b~~h~~h~~h~%02d:%02d:%02d", hours, minutes, seconds);
    TextDrawSetString(clock2, string);
    TextDrawShowForAll(clock1);TextDrawShowForAll(clock2);
}
BUT if "day" more than 28-31(End of month), the months and years are not increase.
Reply


Messages In This Thread
How can i adjust the hour? - by sampmann - 20.12.2012, 17:26
Re: How can i adjust the hour? - by Alexander_Petrov - 20.12.2012, 17:44
Re: How can i adjust the hour? - by sampmann - 20.12.2012, 17:53
Re: How can i adjust the hour? - by Alexander_Petrov - 20.12.2012, 17:57
Re: How can i adjust the hour? - by Alexander_Petrov - 20.12.2012, 18:04
Re: How can i adjust the hour? - by sampmann - 20.12.2012, 18:14
Re: How can i adjust the hour? - by Alexander_Petrov - 20.12.2012, 18:29
Re: How can i adjust the hour? - by sampmann - 20.12.2012, 18:46
Re: How can i adjust the hour? - by Alexander_Petrov - 20.12.2012, 18:52
Re: How can i adjust the hour? - by sampmann - 20.12.2012, 19:02

Forum Jump:


Users browsing this thread: 1 Guest(s)