String -
x96664 - 17.07.2013
Hello everyone! I was thinking about something.
Is '\n' symbol for new line - a character ? i.e. I'm using a register system in a dialog which shows some info like username init:
pawn Код:
new string[164], playername[MAX_PLAYER_NAME];
format(string, sizeof(string), ""white"Blabla\n"red"Username: "white"%s\n"red"Enter your password:", playername);
ShowPlayerDialog(playerid,RegisterDialog,DIALOG_STYLE_INPUT,""white"Register:",string,"Register","Quit");GetPlayerName(playerid, playername, sizeof(playername));
Also the color name like: "white" and "red" .
Because I want to decrease the size of the string to 124 or maybe lower, but I am not sure are these things which I've asked about, being characters so I musn't change the string size.
Re: String -
Smokkr - 17.07.2013
Yes, "\n" is for new line.Example: "New\nline".Will display:
OFF: Kukata the best
Re: String -
Sgt.TheDarkness - 17.07.2013
Define the string globally, as ****** said, you only need to use 128 cells for strings, it's a pure waste to go over that size unless you're using it for dialogs! You can use that globally on whatever you'd like, by the way.
Re: String -
Calvingreen17 - 17.07.2013
\n Stands for new line.
if you made a Dialog box:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,"T est,"This is how\nIt works","Close","");
It would show a box with the message:
This is how
It works
You understand?
Re: String -
x96664 - 17.07.2013
Quote:
Originally Posted by Smokkr
Yes, "\n" is for new line.Example: "New\nline".Will display:
OFF: Kukata the best 
|
No, you didn't get my question. I didn't ask if is '\n' for new line, I know what is it for as '\t' is used to add tab. My question was is it being counted for a character in the string.
OFF: Ofcourse
Re: String -
x96664 - 17.07.2013
Quote:
Originally Posted by Sgt.TheDarkness
Define the string globally, as ****** said, you only need to use 128 cells for strings, it's a pure waste to go over that size unless you're using it for dialogs! You can use that globally on whatever you'd like, by the way.
|
What if the text in the dialog is longer ? It will cut it off.
AW: String -
BigETI - 17.07.2013
All readable and non readable characters take 1 cell each character.
So a string like
will take 4 slots, because 3 new line characters + null character.
It is technically called a null terminating string.
13 characters + null character = 14 cells