SA-MP Forums Archive
How do I add a new line when using format() - 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: How do I add a new line when using format() (/showthread.php?tid=496943)



How do I add a new line when using format() - Bubbly - 24.02.2014

I'm trying to add a new line when using format, I'm using \n but it isn't creating a new line.

Is there a special way of doing this?

(I am a fairly new coder, and I have some stuff to learn)


Re: How do I add a new line when using format() - ColeMiner - 24.02.2014

"\n" for some things, "~n~" for some other things, a whole separate message for yet others. It depends on where you want the new line.


Re: How do I add a new line when using format() - Bubbly - 24.02.2014

This is my format line

Код:
	format(String, sizeof(String), "{B282FA}[INFO] {B3B3B3}Your name is: %s \n{B282FA}[INFO] {B3B3B3}Your IP address: %s", pName, ip);



Re: How do I add a new line when using format() - FilesMAker - 24.02.2014

if you will send it by SendClientMessage it will not be shown you can use it just on dialog box or Text draw.


Re: How do I add a new line when using format() - Threshold - 24.02.2014

In terms of SendClientMessage, you can only create a new line by either sending multiple instances of SendClientMessage, or using split. I personally think it's easier to just send two SendClientMessage's.

pawn Код:
format(String, sizeof(String), "[INFO] {B3B3B3}Your name is: %s", pName);
SendClientMessage(playerid, 0xB282FAFF, String);
format(String, sizeof(String), "[INFO] {B3B3B3}Your IP address: %s", ip);
SendClientMessage(playerid, 0xB282FAFF, String);



Re: How do I add a new line when using format() - Bubbly - 24.02.2014

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
In terms of SendClientMessage, you can only create a new line by either sending multiple instances of SendClientMessage, or using split. I personally think it's easier to just send two SendClientMessage's.

pawn Код:
format(String, sizeof(String), "[INFO] {B3B3B3}Your name is: %s", pName);
SendClientMessage(playerid, 0xB282FAFF, String);
format(String, sizeof(String), "[INFO] {B3B3B3}Your IP address: %s", ip);
SendClientMessage(playerid, 0xB282FAFF, String);
Thank you all very much, this post helped.