12.02.2014, 21:48
Why do you define twice? You shall define it on top of your script.
That's the code.
pawn Код:
// top (after a_samp)
#define SERVER_STATS "serverstats.cfg"
stock LoadServerStats()
{
if(!fexist(SERVER_STATS)) return 1;
new File:i_FileHandle = fopen(SERVER_STATS, io_read), sz_FileStr[256];
fread(i_FileHandle, sz_FileStr);
//sscanf(sz_FileStr, "iiiiiiiiiiii", TotalLogin, TotalConnect, TotalAutoBan, TotalRegister, MaxPlayersConnected, MPDay, MPMonth, MPYear, MPHour, MPMinute, TotalUptime);
//sz_FileStr = TotalLogin;
return fclose(i_FileHandle);
}
stock SaveServerStats()
{
new sz_FileStr[256];
new File:i_FileHandle = fopen(SERVER_STATS, io_write);
//format(sz_FileStr, sizeof(sz_FileStr), "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", TotalLogin, TotalConnect, TotalAutoBan, TotalRegister,MaxPlayersConnected,MPDay,MPMonth,MPYear,MPHour,MPMinute,TotalUptime);
format(sz_FileStr, 256, "%d", TotalLogin);
fwrite(i_FileHandle, sz_FileStr);
return fclose(i_FileHandle);
}