20.07.2015, 12:35
Quote:
You can easily do this with the file system. Take a look at this.
|
Quote:
You can make that with both of them ..
There we are : Код:
stock const MonthDays[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; stock DateTimeGet(Plus) { getdate(Year, Month, Day); gettime(Hour, Minute, Second); Day += Plus; if(Day >= MonthDays[Month]) { Month++; Day -= MonthDays[Month-1]; } if(Month >= 12) { Year++; Month -= 12; } } Код:
public SetPlayerDriverLicense(playerid) { DateTimeGet(30); pLicense[playerid][pDriver] = 1; pLicense[playerid][pDriverLY] = Year; pLicense[playerid][pDriverLM] = Month; pLicense[playerid][pDriverLD] = Day; pLicense[playerid][pDriverLH] = Hour; pLicense[playerid][pDriverLMIN] = Minute; pLicense[playerid][pDriverLS] = Second; new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File, "Licenses"); INI_WriteInt(File, "DriverLicense", 1); INI_WriteInt(File, "DriverLicense_Year", Year); INI_WriteInt(File, "DriverLicense_Month", Month); INI_WriteInt(File, "DriverLicense_Day", Day); INI_WriteInt(File, "DriverLicense_Hour", Hour); INI_WriteInt(File, "DriverLicense_Minute", Minute); INI_WriteInt(File, "DriverLicense_Second", Second); INI_Close(File); } Код:
new Year, Month, Day, Hour, Minute, Second EDIT: When player connect you need to check (Put a timer) if actual date (getdate & gettime) = your array .. In my case Код:
pLicense[playerid][pDriverLY] = Year; pLicense[playerid][pDriverLM] = Month; pLicense[playerid][pDriverLD] = Day; pLicense[playerid][pDriverLH] = Hour; pLicense[playerid][pDriverLMIN] = Minute; pLicense[playerid][pDriverLS] = Second; I hope you understand what i said to you .. |