17.10.2012, 13:06
Okay, take a look at the following codes:
Okay, as you can see, all it does is write the logs to a file Admin.txt
Its supposed to enter line by line in the file, but when I open the file, everything's in a mixed up state.
This is how it looks like:

It's hard to read and understand anything. (But when I turn off word wrap, everything comes in a straight line)
Also notice that the player name doesn't show up properly in the line at the end, a 'Ь' comes in front of the name.
Please do help.
pawn Код:
CMD:something(playerid,params[]) //ignore what the cmd is...
{
//~~~~~~~~~~
new Day,Month,Year,Hour,Minute,Second,text[250];
gettime(Hour,Minute,Second); getdate(Year, Month, Day);
format(text,sizeof(text)," || %d/%d/%d - %d:%d:%d || [Admin Log]: %s has done something...
",Day,Month,Year,Day,Month,Year,Hour,Minute,Second,name);
AdminLog(text);
//~~~~~~
forward AdminLog(string[]);
public AdminLog(string[])
{
new entry[500];
format(entry, sizeof(entry), "%s\r\n",string);
new File:hFile;
hFile = fopen("/Logs/Admin.txt", io_append);
fwrite(hFile, entry);
fwrite(hFile," \n ");
fclose(hFile);
}
Its supposed to enter line by line in the file, but when I open the file, everything's in a mixed up state.
This is how it looks like:

It's hard to read and understand anything. (But when I turn off word wrap, everything comes in a straight line)
Also notice that the player name doesn't show up properly in the line at the end, a 'Ь' comes in front of the name.
Please do help.