SA-MP Forums Archive
No rows or tabulation in dialog. - 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: No rows or tabulation in dialog. (/showthread.php?tid=363423)



No rows or tabulation in dialog. - Kiets - 27.07.2012

Hey. I am currently experiencing a problem and can't find a way to fix it.
Let's say i have in a mysql database a string (with \t, \n and such things) saved and i want to show it in a dialog. I receive the string from the database, format the dialog by inserting the string there, but there are no rows or tabulation and so. If a string in database is
"test1\ntest2\ntest3"
it will show how it is like instead of
"test1
test2
test3".
Anyone knows where is the problem? Thank you.


Re: No rows or tabulation in dialog. - Kiets - 27.07.2012

I am bumping the topic, because i still don't find anything what could be wrong there and this topic goes further from the first page.


Re: No rows or tabulation in dialog. - milanosie - 27.07.2012

Do you expect us to fibd the problem without showing us the code?
Ansmd dont bump
Written ob phone so sorry for spellibg mistakes


Re: No rows or tabulation in dialog. - Kiets - 28.07.2012

Nope, but i think my post is enough to understand everything.


Re: No rows or tabulation in dialog. - sleepysnowflake - 28.07.2012

Yeah, you actually save them as new rows, not as pieces of string. So, do like this, I guess:

pawn Код:
print("This will be\n a new row.")
print("While this one '\n' won't be.")



Re: No rows or tabulation in dialog. - Kiets - 28.07.2012

I think you do not understand me, so let me explain more.
In the database in 1 field i have saved a string "Row1\nRow2\nRow3", it's exactly like that.
In the script i have made like this:
Код:
new text[100];
mysql_query("SELECT `sometext` FROM `blablabla` WHERE `Something` = 5415");
mysql_store_result();
if(mysql_num_rows() == 1) mysql_fetch_row(text);
mysql_free_result();
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"Dialog",text,"Accept", "Back");
I have also tried to print the text in the console to be sure if it's the right one and it prints exactly like it is saved in database (that's normal), but why in dialog it doesn't show how it should?


Re: No rows or tabulation in dialog. - sleepysnowflake - 28.07.2012

So it shows like

Код:
row1
row2
row3
Or it shows as

Код:
 row1 row2 row3
And you want it as in the first example?


Re: No rows or tabulation in dialog. - Kiets - 28.07.2012

It shows this in dialog: "Row1\nRow2\nRow3", with all \n's inside.


Re: No rows or tabulation in dialog. - Kiets - 28.07.2012

Well, already many hours passed, so i am just bumping, because i can't let this topic die.


Re: No rows or tabulation in dialog. - Kiets - 28.07.2012

Sorry, but maybe i explained my problen not enough? Just tell, i am ready to help you if you can help me.