Server Log help
#3

Hi i edited it and i got a Warning

Code

pawn Код:
#include <a_samp>

forward Serverlog(string[]);

public Serverlog(string[])
{
    new Year, Month2, Day;
    getdate(Year, Month2, Day);
   
    new Hour, Minute, Second;
    gettime(Hour, Minute, Second);
   
    new entry[128 + 64];
    format(entry, sizeof(entry), "[%02d.%02d.%d | %02d:%02d:%02d] %s\r\n",Day, Month2, Year, Hour, Minute, Second, string);

    new File:hFile;
    format(string, sizeof(string), "Server/Logs/%02d.%s.%02d.log", Day, GetMonth(), Year); //Шine 17
    hFile = fopen(string, io_append);
    fwrite(hFile, entry);
    fclose(hFile);
    return 1;
}

public OnPlayerText(playerid, text[])
{
    Serverlog(text);
    return 1;
}

stock GetMonth()
{
    new monthname[10], Year, Month1, Day;
    getdate(Year, Month1, Day);

    switch(Month1)
    {
        case 1:  monthname = "January";
        case 2:  monthname = "February";
        case 3:  monthname = "March";
        case 4:  monthname = "April";
        case 5:  monthname = "May";
        case 6:  monthname = "June";
        case 7:  monthname = "July";
        case 8:  monthname = "August";
        case 9:  monthname = "September";
        case 10: monthname = "October";
        case 11: monthname = "November";
        case 12: monthname = "December";
    }
    return monthname;
}
Warning
Код:
C:\Users\Unknown123\Documents\Server\filterscripts\ServerLog.pwn(17) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
But will this log like this?

6.March.2011
7.March.2011
Then so on

Like it should be in my "Logs folder":
6.March.2011.log
7.March.2011.log
8.March.2011.log
9.March.2011.log
Reply


Messages In This Thread
Server Log help - by Unknown123 - 07.03.2011, 14:00
Re: Server Log help - by pawn_ - 07.03.2011, 16:14
Re: Server Log help - by Unknown123 - 07.03.2011, 18:32
Re: Server Log help - by bigcomfycouch - 07.03.2011, 18:57
Re: Server Log help - by Unknown123 - 07.03.2011, 19:11
Re: Server Log help - by bigcomfycouch - 07.03.2011, 19:24
Re: Server Log help - by Unknown123 - 07.03.2011, 19:25

Forum Jump:


Users browsing this thread: 1 Guest(s)