SA-MP Forums Archive
String replace - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: String replace (/showthread.php?tid=110158)



String replace - Lenny_Carlson - 24.11.2009

I've heard of it somewhere, but I've never heard about it being used in this way.

I have a string, for example:
Код:
format(string, sizeof(string), "Hello, %s\n\nYou are really old.\n%s\n\nYeah that's right!", name, something);
I want to print this in chat, but since \n doesn't work there I probably need a function(?) to fix this issue.

What I want is this result:
Quote:

Hello Lenny

You are really old
Something

Yeah that's right!

In the text chat.


The reason I have it in a string is because I'm using it for a dialog, I just want to be able to print it in text too.


Re: String replace - mamorunl - 24.11.2009

SendClientMessages under each other eg:

SendClientMessage(playerid, COLOR, "Hi Boss");
SendClientMessage(playerid, COLOR, ""); // for an empty one
SendClientMessage(playerid, COLOR, "How are you");

as an example, you can ofc use your format to show other text there.


Re: String replace - Lenny_Carlson - 24.11.2009

Yes, but how do I divide the text into more than one string?