fwrite crashing my server?
#1

Hello, to familiarize myself with the original file functions I decided to make a simple chatlog for practice. Only problem is that whenever I type anything in the main chat my server crashes. This is my file writing code. No errors on compiling either.

This is defined at the top of my script.
pawn Код:
#define LOG                 "../Server/log.txt"
OnPlayerText.
pawn Код:
public OnPlayerText(playerid, text[])
{
    new pname[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, pname, sizeof(pname));
    strreplace(pname,'_',' ');

    format(str, sizeof(str), "(American accent) %s says: %s", pname, text);
    ProxDetector(30.0, playerid, str, COLOR_WHITE);
    new lstring[254],File:log = fopen(LOG,io_write);
    format(lstring,254,"[chat] %s: %s",pname,text);
    fwrite(log,lstring);
    fclose(log);
    return 0;
}
and before you ask, yes, I do have the
Код:
log.txt
file in my server directory in the "Server" file. Also, my server-log shows nothing but the last text I typed.
Reply


Messages In This Thread
fwrite crashing my server? - by Walsh - 01.03.2012, 01:42
Re: fwrite crashing my server? - by 2KY - 01.03.2012, 01:43
Re: fwrite crashing my server? - by Walsh - 01.03.2012, 01:49
Re: fwrite crashing my server? - by 2KY - 01.03.2012, 01:50
Re: fwrite crashing my server? - by Walsh - 01.03.2012, 01:57
Re: fwrite crashing my server? - by 2KY - 01.03.2012, 01:59

Forum Jump:


Users browsing this thread: 1 Guest(s)