SA-MP Forums Archive
A problem here - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A problem here (/showthread.php?tid=328376)



A problem here - Youwannaplayarough?OKAY! - 24.03.2012

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<,>iiiiiiiiiii", TotalLogin, TotalConnect, TotalAutoBan, TotalRegister, MaxPlayersConnected, MPDay, MPMonth, MPYear, MPHour, MPMinute, TotalUptime);
    return fclose(i_FileHandle);
}
This is for /serverstats command and it says a error when i do it this one
pawn Код:
error 035: argument type mismatch (argument 3)



Re: A problem here - The DeLuca - 25.03.2012

Because the callback is LoadServerStats() with no variables but you're checking if a file exists with the variable "SERVER_STATS". In order for that to make sense it would need to be, LoadServerStats(SERVER_STATS)


Re: A problem here - MP2 - 25.03.2012

Quote:
Originally Posted by The DeLuca
Посмотреть сообщение
Because the callback is LoadServerStats() with no variables but you're checking if a file exists with the variable "SERVER_STATS". In order for that to make sense it would need to be, LoadServerStats(SERVER_STATS)
No. It is probably defined somewhere else.

Which line is the error on?


Re: A problem here - The DeLuca - 25.03.2012

Код:
  new File: i_FileHandle = fopen("serverstat.ini", io_read), sz_FileStr[256];
That's your problem.


Re: A problem here - MP2 - 25.03.2012

Yeah, it does look sort of strange. Put them on seperate lines.