07.10.2012, 22:46
(
Последний раз редактировалось Face9000; 08.10.2012 в 08:40.
)
Hello,i made a little server stats code for saving the stats of my server (kills,bans etc),but i have a problem.
The code is this:
It doesn't even open,read and write into the file,nothing.
The serverstat.ini is placed in /scriptfiles folder.
What can be the problem?
The code is this:
pawn Код:
LoadServerStats()
{
if(!fexist(SERVER_STATS)) return 1;
new File: i_FileHandle = fopen("serverstat.ini", io_read), sz_FileStr[256];
fread(i_FileHandle, sz_FileStr);
sscanf(sz_FileStr, "p<,>iiiiiii", TotalConnect,TotalAutoBan,TotalRegister,TotalUptime,TotalAdminBans,TotalAdminKicks,TotalLottoWins);
return fclose(i_FileHandle);
}
SaveServerStats()
{
new sz_FileStr[256], File: i_FileHandle = fopen(SERVER_STATS, io_write);
format(sz_FileStr, sizeof(sz_FileStr), "%d,%d,%d,%d,%d,%d,%d", TotalConnect,TotalAutoBan,TotalRegister,TotalUptime,TotalAdminBans,TotalAdminKicks,TotalLottoWins);
fwrite(i_FileHandle, sz_FileStr);
return fclose(i_FileHandle);
}
The serverstat.ini is placed in /scriptfiles folder.
What can be the problem?