Time clock help (+1 rep) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Time clock help (+1 rep) (
/showthread.php?tid=587623)
Time clock help (+1 rep) -
haikalxd6 - 01.09.2015
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);
}
Re: Time clock help (+1 rep) -
Jefff - 01.09.2015
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);
}
Re: Time clock help (+1 rep) -
haikalxd6 - 01.09.2015
Thanks Jefff +rep