Save / Load prob
#2

Why do you define twice? You shall define it on top of your script.

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);
}
That's the code.
Reply


Messages In This Thread
Save / Load prob - by JacobSanchez - 12.02.2014, 21:45
Re: Save / Load prob - by Private200 - 12.02.2014, 21:48
Re: Save / Load prob - by JacobSanchez - 12.02.2014, 22:49
Re: Save / Load prob - by JacobSanchez - 14.02.2014, 23:55
Re: Save / Load prob - by CuervO - 15.02.2014, 02:21
Re: Save / Load prob - by JacobSanchez - 15.02.2014, 12:12

Forum Jump:


Users browsing this thread: 1 Guest(s)