fwrite crashes server?
#1

Hi.
I'm using dFile include and it crashes my server while using fwrite function.

Код:
[14:43:55] [debug] Server crashed while executing new.amx
[14:43:55] [debug] AMX backtrace:
[14:43:55] [debug] #0 native fwrite () [00405710] from samp-server.exe
[14:43:55] [debug] #1 0000685c in Debug_Print0 () at C:\Users\mindaugas\Desktop\GRP4(2)\GRP4(2)\GRP4\pawno\include\dfile.inc:327
[14:43:55] [debug] #2 00283e38 in public Zaidimas () at C:\Users\mindaugas\Desktop\GRP4(2)\GRP4(2)\GRP4\gamemodes\new.pwn:4809
[14:43:55] [debug] System backtrace:
[14:43:55] [debug] #0 00492860 in ?? () from C:\Users\mindaugas\Desktop\GRP4(2)\GRP4(2)\GRP4\samp-server.exe
[14:43:55] [debug] #1 0040534e in ?? () from C:\Users\mindaugas\Desktop\GRP4(2)\GRP4(2)\GRP4\samp-server.exe
Any suggestions?
BTW it crashes only when server has over 2 players. With 1 player it doesn't crash.
Reply
#2

Show me line 4809 of your gamemode script
Reply
#3

Quote:

}
}
end_of_min_top:
dfile_SaveFile();//This
}

End of min top loop:

Quote:

if(!strcmp(name, dfile_ReadString("MINPlace1"), true))
{
dfile_WriteInt("Place1Min", playerDB[playerid][Played]);
goto end_of_min_top;
}

I'm making TOP5 system, which checks every minute player stats and writes them to file, if player is in 1st, 2nd... 5th place.
Reply
#4

It needs to check if the file exists when it's about to open it and write in it.

The include file you use must check that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)