SA-MP Forums Archive
time log command - please help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: time log command - please help (/showthread.php?tid=513109)



time log command - please help - Miladajir - 14.05.2014

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?


Re: time log command - please help - Konstantinos - 14.05.2014

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);
    }
}



Re: time log command - please help - Miladajir - 14.05.2014

thanks for help