Time clock help (+1 rep)
#1

how do i add 12 more hour to my server's time?

its showing to me the exactly minutes and seconds but the hour is 12 hour down..

how do i add 12 hour plus to the clock?...

Код:
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/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
        TextDrawSetString(Date, string);
        format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
        TextDrawSetString(Time, string);
}
Reply
#2

pawn Код:
public settime(playerid)
{
    new string[15],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);

    hours += 12;
    if(hours >= 24)
        hours -= 24;

    format(string, sizeof string, "%02d:%02d:%02d", hours, minutes, seconds);
    TextDrawSetString(Time, string);
}
Reply
#3

Thanks Jefff +rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)