Not parsing \n
#1

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.
Reply
#2

Try
Код:
\r\n
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)