\n not working
#1

Код:
CMD:create(playerid)
{
new string[174];
new Float:x[50], Float:y[50], Float:z[50];
for(new i=0; i<50; i++)
{
if(x[i]==0.0 && y[i]==0.0 && z[i]==0.0)
{
GetPlayerPos(playerid,x[i], y[i] ,z[i]);
format(string, sizeof(string), "x[%i]=%f, y[%i]=%f,z[%i]=%f-0.9\n", i, x[i], i, y[i], i, z[i]);
break;
}
}
new File:lFile = fopen("logs/poz.txt", io_append);
fwrite(lFile, string);
fclose(lFile);

return 1;
}
I wrote "create" few times and all the time text appears in file "poz" in one single line. As you can see i'm using "\n" but it doesn't do affect.
Reply
#2

Try \r\n instead of just \n.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Try \r\n instead of just \n.
Thank you
Reply
#4

No problem, just note that there are differences between pawn lines and file lines, always use \r\n when working with files, and \n when using newlines within PAWN.
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
No problem, just note that there are differences between pawn lines and file lines, always use \r\n when working with files, and \n when using newlines within PAWN.
Yes, now I know. I ******d that right after your first comment. Thanks again.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)