SA-MP Forums Archive
Log issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Log issue (/showthread.php?tid=595686)



Log issue - TwinkiDaBoss - 06.12.2015

Alright the problem is simple, it wont insert every message sent, it tends to save 1 message once and then no response

PHP код:
public IC_ChatLog(LogString[]) {
    new 
entry[128],YearMonthDayHourMinuteSecond;
    
getdate(YearMonthDay);
    
gettime(HourMinuteSecond);
    
format(entrysizeof(entry), "\r\n[%02d/%02d/%d][%02d:%02d:%02d]%s",Day,Month,YearHourMinuteSecond,LogString);
    
fwrite(ICChatLogFile,entry);
    return 
true;
}
OnPlayerText
format
(messagesizeof(message), "%s says: %s"GetRoleplayName(playerid), text);
    
IC_ChatLog(message); 
Destination, opening OnGameModeInit
pawn Код:
ICChatLogFile = fopen("Logs/Chat/InCharacter.log",io_append);

Closing the log OnGameModeExit
pawn Код:
fclose(ICChatLogFile);



Re: Log issue - CmZxC - 06.12.2015

Have you tried closing the file every time you log and opening right before logging?
It shouldn't be much more taxing than it currently is, but don't take my word on it.


Re: Log issue - TwinkiDaBoss - 06.12.2015

Pfft to be honest, thats what I wanted to skip. I used that system, doesnt really turns out as efficiant