PDA

View Full Version : time log command - please help


Miladajir
14/05/2014, 04:19 PM
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?

Konstantinos
14/05/2014, 04:30 PM
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);
}
}

Miladajir
14/05/2014, 04:39 PM
thanks for help