Stock does'nt work correct...
#1

pawn Код:
#define ServerLog       "Server/Log/%02d-%02d-%04d.txt"

public OnPlayerSpawn(playerid)
{
    PrintX("Lol? (ID %d)", playerid);
}



stock PrintX(const string[], {Float,_}:...)
{
    new Hour, Minute, Second;
    new Year, Month, Day;
    new LogFile[128], entry[128], File:Log;
    gettime(Hour, Minute, Second);
    getdate(Year, Month, Day);
    format(LogFile, sizeof(LogFile), ServerLog, Day, Month, Year);
    if(!fexist(LogFile))
    {
        dini_Create(LogFile);
        printf("New Log File: %02d-%02d-%04d.txt", Day, Month, Year);
        Log = fopen(LogFile, io_append);
        format(entry, sizeof(entry), "[%02d:%02d:%02d] %s\r\n", Hour, Minute, Second, string);
        fwrite(Log, entry);
        fclose(Log);
    }
    else
    {
        format(entry, sizeof(entry), "[%02d:%02d:%02d] %s\r\n", Hour, Minute, Second, string);
        Log = fopen(LogFile, io_append);
        fwrite(Log, entry);
        fclose(Log);
    }
    return 1;
}
And what do i get in my custom log?

Quote:

[15:24:02] Lol? (ID %d)

What am I forgotten?
Reply


Messages In This Thread
Stock does'nt work correct... - by Remi-X - 19.06.2009, 13:32
Re: Stock does'nt work correct... - by Correlli - 19.06.2009, 13:58
Re: Stock does'nt work correct... - by Remi-X - 19.06.2009, 14:04
Re: Stock does'nt work correct... - by Remcconen - 19.06.2009, 14:38
Re: Stock does'nt work correct... - by Remi-X - 19.06.2009, 14:54
Re: Stock does'nt work correct... - by yezizhu - 19.06.2009, 15:16
Re: Stock does'nt work correct... - by Remi-X - 19.06.2009, 15:28
Re: Stock does'nt work correct... - by yezizhu - 19.06.2009, 16:04
Re: Stock does'nt work correct... - by Nero_3D - 19.06.2009, 16:26
Re: Stock does'nt work correct... - by Remi-X - 19.06.2009, 16:50

Forum Jump:


Users browsing this thread: 1 Guest(s)