30.06.2011, 17:47
How can I check when is Saturday?
Thanks
Thanks
new hour, minutes;
GetPlayerTime(playerid, hour, minutes);
if(hour == 13 && minutes == 37)
{
//do w/e
}
native getdate(&year=0, &month=0, &day=0);
GetWeekName(day=0, month=0, year=0)
{
new
sStr[24] = "Invalid",
iBissext = (year % 100),
iWeekDay = (year / 100);
if(month < 3) month += 12,year--;
new iWeek = ((day + (month+1)*26/10 + iBissext + iBissext/4 + iWeekDay/4 - 2*iWeekDay) % 7);
sStr =
(
(iWeek == 0x0) ? ("Saturday") :
(iWeek == 0x1) ? ("Sunday") :
(iWeek == 0x2) ? ("Morning") :
(iWeek == 0x3) ? ("Tuesday" :
(iWeek == 0x4) ? ("Wednesday") :
(iWeek == 0x5) ? ("Thursday") :
(iWeek == 0x6) ? ("Friday") : ("Invalid")
);
return sStr;
}