time log command - please help
#1

hello
i have small problem.
Код:
stock kick(event[])
{
  new File:log = fopen("/Admin/Logs/commands/kick.txt", io_append);
  fwrite(log, event);
  fwrite(log, "\r\n");
  fclose(log);
}
Want to save time.
example:
[07:45:34]Admininistrator %s Player %s Kicked. reason:%s
What do I do?
Reply
#2

pawn Код:
kick(event[])
{
    new File:log = fopen("/Admin/Logs/commands/kick.txt", io_append);
    if (log)
    {
        new Hour, Minute, Second, szTime[11];
        gettime(Hour, Minute, Second);
        format(szTime, sizeof (szTime), "[%02d:%02d:%02d]", Hour, Minute, Second);
        fwrite(log, szTime);
        fwrite(log, event);
        fwrite(log, "\r\n");
        fclose(log);
    }
}
Reply
#3

thanks for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)