Log Saving not starting new line.
#1

Hello, I've made a MAPPER Log for each mapping command ingame, as someone removed everything. (admin probarly).
Now, I had a backup so it doesnt matter.
Now I want to make a log system to catch such a children in the future.

I've made a Map saving log system.
And it is working.
But, it isnt starting a new line like I asked, for each log.
For ban it is starting a new line.
But why not for Mapping log?

pawn Код:
public BanLog(string[])
{
    new entry[256];
    format(entry, sizeof(entry), "%s\n",string); // This one working perfectly. :)
    new File:hFile;
    hFile = fopen("ban.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}

public MapLog(string[])
{
    new entry[256];
    format(entry, sizeof(entry), "%s\n",string); // This one WONT start a NEW LINE
    new File:hFile;
    hFile = fopen("map.log", io_append);
    fwrite(hFile, entry);
    fclose(hFile);
}
Reply
#2

Try making maplog manually using notepad?
Reply
#3

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Try making maplog manually using notepad?
...?
There are like 5000 objects being editted/saved/created/deleted each day.
Wont make a maplog myself.
Reply
#4

Quote:
Originally Posted by VerticalGaming
Посмотреть сообщение
...?
There are like 5000 objects being editted/saved/created/deleted each day.
Wont make a maplog myself.
Sure, Nvm what you are doing, If you think you know then go ahead ^^

Good luck.
Reply
#5

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Call your service provider he will help you then.

Good luck.
The fuck, are you talking shit?
Service provider?

This is fucking scripted in PAWNO man. I'm using my localhost to test everything.
I was opening it with notepad.

But it wont create a new line. (the log system).
It's a bug in the script, not from the provider/notepad thingy.
Dammed bro.
Reply
#6

pawn Код:
format(entry, sizeof(entry), "%s\r\n",string);
Use \r\n to start a new line, if that is the problem you have.
Reply
#7

Quote:
Originally Posted by VerticalGaming
Посмотреть сообщение
The fuck, are you talking shit?
Service provider?

This is fucking scripted in PAWNO man. I'm using my localhost to test everything.
I was opening it with notepad.

But it wont create a new line. (the log system).
It's a bug in the script, not from the provider/notepad thingy.
Dammed bro.
I replied on wrong thread lol.
It was on downloading issue of a guy.

I editted if you have patience.

Edit: (Try) Open it with wordpad.
Reply
#8

Check if the file handle is valid before writing to/closing the file to avoid server crashes.

pawn Код:
new File:hFile;
hFile = fopen("map.log", io_append);
if (hFile)
{
    fwrite(hFile, entry);
    fclose(hFile);
}
Do the same for the ban logs as well.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)