[HELP] GetDate - 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: [HELP] GetDate (
/showthread.php?tid=197721)
[HELP] GetDate - Larsey123IsMe - 10.12.2010
How can i change the month?... now it says,
10.12.2010 but i want it to say
10.december[12].2010
pawn Code:
public OnPlayerConnect(playerid)
{
new string[64];
new Year, Month, Day;
getdate(Year, Month, Day);
format(string, sizeof(string), "%02d.%02d.%d", Day, Month, Year);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
Re: [HELP] GetDate - [L3th4l] - 10.12.2010
pawn Code:
stock GetMonth(Month)
{
new MonthStr[15];
switch(Month)
{
case 1: MonthStr = "January";
case 2: MonthStr = "February";
case 3: MonthStr = "March";
case 4: MonthStr = "April";
case 5: MonthStr = "May";
case 6: MonthStr = "June";
case 7: MonthStr = "July";
case 8: MonthStr = "August";
case 9: MonthStr = "September";
case 10: MonthStr = "October";
case 11: MonthStr = "November";
case 12: MonthStr = "December";
}
return MonthStr;
}
pawn Code:
public OnPlayerConnect(playerid)
{
new string[64];
new Year, Month, Day;
getdate(Year, Month, Day);
format(string, sizeof(string), "%02d.%s[%02d].%d", Day, GetMonth(Month), Month, Year);
SendClientMessageToAll(COLOR_RED, string);
return 1;
}
Re: [HELP] GetDate - Larsey123IsMe - 10.12.2010
Thank you