How do I make it in a new line?
#1

Hi guys,
I made a stock of logging commands but It makes it look like
Код:
Player blah performed the command /testPlayer blah performed the command /test
How do I fix this?
the LogCmd stock
PHP код:
stock LogCmd(event[])
{
   new 
File:log fopen(CMD_LOG,io_append);
   
fwrite(log,"\n");
   
fwrite(log,event);
   
fclose(log);

Thanks
Reply
#2

It should be like this:
Код:
new File :log = fopen(CMD_LOG, io_append);
fwrite(log, event);
fwrite(log, "\r\n");
fclose(log);
Reply
#3

Write something to the file and then go to the next line. Checking for invalid file handle is also important to avoid server crashes.

pawn Код:
LogCmd(event[])
{
    new File:log = fopen(CMD_LOG,io_append);

    if (log) return 0;

    fwrite(log,event);
    fwrite(log,"\r\n");
    fclose(log);
    return 1;
}
Reply
#4

Thanks!
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Write something to the file and then go to the next line. Checking for invalid file handle is also important to avoid server crashes.

pawn Код:
LogCmd(event[])
{
    new File:log = fopen(CMD_LOG,io_append);

    if (log) return 0;

    fwrite(log,event);
    fwrite(log,"\r\n");
    fclose(log);
    return 1;
}
This actually gives me a warning :c
EDIT:Oh you fixed it !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)