\n not working
#1

Hi all,

I have kind of a weird thing here..
When I use \n in a format function, like this one here:
pawn Code:
format(string,128,"Welcome %s , thanks for logging in!\nYour last login was on: %d-%d-%d , from IP adress: %s",...);
The \n is ignored, and the text is on one line.
This works in my login dialog, but not in the sent messages.

Anything I'm doing wrong here?
Reply
#2

You cannot use \n with SendClientMessage. AFAIK it (\n) only works with dialog boxes.
Reply
#3

Really?
Hmm, I will send it in 2 messages then, thanks
Reply
#4

Code:
format(string,128,"Welcome %s , thanks for logging in!\nYour last login was on: %d-%d-%d , from IP adress: %s",...);

new string[128];
SendClientMessage(playerid, COLOR_CODE, "%d-%d-%d"); // extra line 1
I'm new in scripting, so I dont know or i'm right or not ^^
Reply
#5

Quote:
Originally Posted by Aarab
View Post
Code:
format(string,128,"Welcome %s , thanks for logging in!\nYour last login was on: %d-%d-%d , from IP adress: %s",...);

new string[128];
SendClientMessage(playerid, COLOR_CODE, "%d-%d-%d"); // extra line 1
I'm new in scripting, so I dont know or i'm right or not ^^
You have to format the %d-%d-%d, you can't just put it into the code and expect it to work. That's why we use the format() function. It allows us to replace %d, %s, %i, %f, etc with values of variables we specify.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)