Date problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Date problem (
/showthread.php?tid=192049)
Date problem -
eXtr1kE - 21.11.2010
pawn Code:
public UpdateDate()
{
new day, month;
getdate(day, month);
new mtext[20];
if(month == 1) { mtext = "January"; }
else if(month == 2) { mtext = "February"; }
else if(month == 3) { mtext = "March"; }
else if(month == 4) { mtext = "April"; }
else if(month == 5) { mtext = "May"; }
else if(month == 6) { mtext = "June"; }
else if(month == 7) { mtext = "Juli"; }
else if(month == 8) { mtext = "August"; }
else if(month == 9) { mtext = "September"; }
else if(month == 10) { mtext = "October"; }
else if(month == 11) { mtext = "November"; }
else if(month == 12) { mtext = "December"; }
format(datestr,sizeof(datestr),"%d %s",day,mtext);
TextDrawSetString(clock,datestr);
}
Wed day instead, put year, so instead of being 21 November, is 2010 November.
Re: Date problem -
eXtr1kE - 21.11.2010

reply ?
Re: Date problem -
randomkid88 - 21.11.2010
getdate is year, month, day. So your variable "day" is actually getting the year.
pawn Code:
getdate(year, month, day);
Re: Date problem - [L3th4l] - 21.11.2010
pawn Code:
new Year, Month, Day; getdate(Year, Month, Day);
format(datestr, sizeof(datestr), "%s | %d | %d", mtext, Day, Year);
TextDrawSetString(clock, datestr);