19.07.2015, 18:15
And now?
- Mencent
PHP код:
public SetPlayerDriverLicense(playerid)
{
printf("DEBUG: 1");
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
Day += 30;
printf("DEBUG: 2");
while(Day >= MonthDays[Month])Month++;
printf("DEBUG: 3");
while(Month >= 12)
{
Year++;
Month -= 12;
}
printf("DEBUG: 4");
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));
printf("UserPath: %s",UserPath(playerid));
printf("DriverLicense_Year: %i",Year);
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);
printf("DEBUG: End");
}