SA-MP Forums Archive
Not parsing \n - 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: Not parsing \n (/showthread.php?tid=285837)



Not parsing \n - adixon009423 - 25.09.2011

Hi,
I have a PHP script, it prints something like that:
Код:
{DD0000}Polish Hard Truck (nie podda się)\nIP: 91.203.223.75:8107\nGracze: 0/30\nGameMode: P-H-T2011\nMapa: PHT2011\nTak\nPogoda: 10\nCzas: 19:04 43\nWersja :0.3c R5
Link: http://cs-belchatow.hmhost.pl/tracke...3.75&port=8107
I'am using HTTP() function to get this text. When I try to show it in DialogBox, i will see something like that:
http://s4.ifotos.pl/img/sa-mp-050_hqhpqwe.png
Text doesn't move to new line. I use this code to display it:
Код:
public HttpResponse(index, response_code, data[])
{

    new buffer[256];
    if(response_code == 200) //Did the request succeed?
    {
        format(buffer, 256, "%s", data);
        ShowPlayerDialog(index, DIALOG_ID_MESSAGE, DIALOG_STYLE_MSGBOX, "Informacje o serwerze", buffer, "OK", "");
    }
    else
    {
        //No!
        format(buffer, sizeof(buffer), "Error: %d", response_code);
        SendClientMessage(index, 0xFFFFFFFF, buffer);
    }
}
How I can to fix it?
Sorry for my bad english.


Re: Not parsing \n - andrew4699 - 25.09.2011

Try
Код:
\r\n



Re: Not parsing \n - adixon009423 - 25.09.2011

Quote:
Originally Posted by andrew4699
Посмотреть сообщение
Try
Код:
\r\n
Doesn't work
Updated php script: http://cs-belchatow.hmhost.pl/tracke...3.75&port=8107
Screen: http://s2.ifotos.pl/img/sa-mp-051_hqhhhhe.png