Logs...
#1

pawn Код:
forward ServerLog(playerid, string[]);

public ServerLog(playerid, string[])
{
    new day, month, year, hour, minute, second, entry[192], filename[32], File:file;
    getdate(year, month, day);
    gettime(hour, minute, second);
    format(entry, sizeof (entry), "[%02i:%02i:%02i] %s(%d): %s\r\n", hour, minute, second, PlayerName(playerid), playerid, string);
    format(filename, sizeof (filename), "Server/Logs/%02i.%s.%i.log", day, GetMonth(), year); //
    file = ((fexist(filename)) ? (fopen(filename, io_append)) : (fopen(filename, io_write)));
    fwrite(file, entry);
    fclose(file);
    return 1;
}
Can someone change that to.. so i can use it like this:
pawn Код:
ServerLog("%s(%d) Is a banana", PlayerName(playerid), playerid);

&&

ServerLog(string);
Both in same function?

with other words
Like the "printf"
pawn Код:
printf("%s(%d) Is a banana", PlayerName(playerid), playerid);

&&

printf(string);
Reply


Messages In This Thread
Logs... - by Unknown123 - 07.03.2011, 20:25
Re: Logs... - by Mauzen - 07.03.2011, 20:37
Re: Logs... - by Unknown123 - 07.03.2011, 20:40

Forum Jump:


Users browsing this thread: 1 Guest(s)