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;
}
}
Get actual time and add X days ... DateTimeGet(30) will mean 30 days of valability ... you can stock it so ..
Код:
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);
}
Add at the beginning of the script right under #defines
Код:
new Year, Month, Day, Hour, Minute, Second
P.S that exemple it's from my License Script ..
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;
to set Vip to value 0 (No vip - or how it's at you) ... if(actual date >= my old date) pLicense[playerid][pDriver] = 0; // ... actual date and my old date dosen't exist
it's just so
I hope you understand what i said to you ..