Weird Crash Log
#3

Code:
FUNCTION:WriteInLog(destinationFile[], stringToWrite[])
{
	new
		logFile[32] = "Logs/", date, month, year, hour, minute;
	getdate(date, month, year);
	gettime(hour, minute);
	strcat(logFile, destinationFile);
    if(!fexist(logFile))
    {
        new
			File:fileToCreate = fopen(logFile, io_write);

        fclose(fileToCreate);
    }
    new
		stringForLogging[512];
	format(stringForLogging, 512, "<font color='red'>%d/%d/%d (%d:%d) </font>%s<br/>", date, month, year, hour, minute, stringToWrite);
    new
		File:fileToAppend = fopen(logFile, io_append);
    fwrite(fileToAppend, stringForLogging);
    fclose(fileToAppend);
    return 1;
}
Code:
FUNCTION:UpdateAdminLog(text[])
{
	for(new i = 4; i > 0; i--)
		format(AdminLog[i], 256, "%s", AdminLog[i - 1]);
	format(AdminLog[0], 256, "%s", text);
	for(new i = 0; i < 5; i++)
		TextDrawSetString(GM[AdminLogTD][i], AdminLog[i]);
	WriteInLog("AdminLog.html", text);
	return 1;
}
I've double checked. The files are present to which the function is writing. I'm not sure how i can manage permissions through FTP.
Reply


Messages In This Thread
Weird Crash Log - by Uvais - 23.06.2018, 23:39
Re: Weird Crash Log - by Sew_Sumi - 24.06.2018, 01:22
Re: Weird Crash Log - by Uvais - 24.06.2018, 02:33
Re: Weird Crash Log - by Uvais - 24.06.2018, 02:42
Re: Weird Crash Log - by Sew_Sumi - 24.06.2018, 08:50

Forum Jump:


Users browsing this thread: 1 Guest(s)