Player input dialog \n - no new line -
ATomas - 07.02.2012
Hello,
when the player writes the dialogue input new line (\n) and then he has the same text to view in a new dialogue, so it does not make a new line, but \n writing as text. But when I write to the \n line of code is done.
Код:
// text entered player in the dialog box, this is just an example
new Article1 [128] = "1\n2";
new Article2 [128] = "something";
new Article3 [128] = "something 1\nsomething 2";
new Article4 [128] = "all 3\nnothing";
new stringx [512];
format (stringx, sizeof (stringx), "%s\n\n%s\n\n%s\n\n%s", Article1, Article2, Article3, Article4),
ShowPlayerDialog (playerid,0,DIALOG_STYLE_MSGBOX,"News",stringx,"Close","");
in the text dialogue would therefore look like:
Код:
1
2
something
something 1
something 2
all 3
nothing
but the text in the dialog looks like:
Код:
1\n2
something
something 1\nsomething 2
all 3\nnothing
How do I do that the text displayed in the dialog the first time and not the second?
Re: Player input dialog \n - no new line - T0pAz - 07.02.2012
What are you really trying to achieve?
Re: Player input dialog \n - no new line -
ATomas - 07.02.2012
I try to reach the options to players to write news, so here is where you need to insert a new line.
I want a player will write a dialogue \n taking of new line has done and did not write it as text.
Re: Player input dialog \n - no new line -
iTorran - 07.02.2012
If you type \n while ingame it will appear on whatever you are displaying it on as \n
Re: Player input dialog \n - no new line -
Konstantinos - 07.02.2012
That's possible only in Pawn. If you type in-game \n, it will display this as text and not as new line.
Re: Player input dialog \n - no new line -
Madd Kat - 07.02.2012
have you tried it with a carriage return with it like?
\r\n
if not make a function that checks player text and formatt any \n with a real one in the script.
Re: Player input dialog \n - no new line -
ATomas - 07.02.2012
Quote:
Originally Posted by Madd Kat
have you tried it with a carriage return with it like?
\r\n
if not make a function that checks player text and formatt any \n with a real one in the script.
|
\r\n didnt work too
Another problem is that if you make it to write other characters that are then \n transcript would be valid
inputtext [i] = '\';
Pawno told me:
error 027: invalid character constant