21.08.2015, 18:08
Quote:
I dont want logs but function
look here how it should be correct without crashing https://sampwiki.blast.hk/wiki/Fwrite |
Код:
stock ChatLog(playerid, text[]) { new File:lFile = fopen("FreeRoam/Logs/Chat Log.txt", io_append), logData[178], fyear, fmonth, fday, fhour, fminute, fsecond; getdate(fyear, fmonth, fday); gettime(fhour, fminute, fsecond); format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s(%d): %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, GetName(playerid), playerid, text); fwrite(lFile, logData); fclose(lFile); return 1; } stock VipChatLog(playerid, text[]) { new File:lFile = fopen("FreeRoam/Logs/VIP Chat Log.txt", io_append), logData[178], fyear, fmonth, fday, fhour, fminute, fsecond; getdate(fyear, fmonth, fday); gettime(fhour, fminute, fsecond); format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] %s(%d): %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, GetName(playerid), playerid, text); fwrite(lFile, logData); fclose(lFile); return 1; } stock AdminChatLog(playerid, text[]) { new File:lFile = fopen("FreeRoam/Logs/Admin Chat Log.txt", io_append), logData[178], fyear, fmonth, fday, fhour, fminute, fsecond; getdate(fyear, fmonth, fday); gettime(fhour, fminute, fsecond); format(logData, sizeof(logData),"[%02d/%02d/%04d %02d:%02d:%02d] (Admin Level: %d) %s(%d): %s \r\n", fday, fmonth, fyear, fhour, fminute, fsecond, PlayerInfo[playerid][pAdmin], GetName(playerid), playerid, text); fwrite(lFile, logData); fclose(lFile); return 1; }