How do I add a new line when using format()
#1

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

"\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.
Reply
#3

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);
Reply
#4

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

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);
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)