Long line
#1

Hy,
I have to type too much in a line, how can i divide it so all i need can fit xD
and it s a format(string line
Reply
#2

pawn Код:
new string[1024];
format(string, sizeof(string), "Text text text text blah blah...");
format(string, sizeof(string), "%s... blah blah on here ...", string);
format(string, sizeof(string), "%s... and some more.", string);
To start a new line in a dialog use \r\n .

Jeffry
Reply
#3

Or use strcat
pawn Код:
new
     Msg[ 1024 ];

strcat( Msg, "Text text text text blah blah..." );
strcat( Msg, "... blah blah on here ..." );
strcat( msg, "... and some more." );

ShowPlayerDialog( .../* parameters */, Msg, "Button1", "Button2" );
Reply
#4

I did like that
new gangsstring[1024];
format(gangsstring, sizeof(gangsstring), "[ID:0] %s",FactionInfo[0][fName]);
...
format(gangsstring, sizeof(gangsstring), "\n[ID:28] %s",FactionInfo[28][fName]);
format(gangsstring, sizeof(gangsstring), "\n[ID:29] %s",FactionInfo[29][fName]);
ShowPlayerDialog(playerid,72,0,"Gangs",gangsstring ,"I see","Ok");

but only last line appears
if in strcat mode only first 2 line appears
ty for help anyways
Reply
#5

pawn Код:
new gangsstring[1024];
format(gangsstring, sizeof(gangsstring), "%s[ID:0] %s",gangstring,FactionInfo[0][fName]);
...
format(gangsstring, sizeof(gangsstring), "%s\n[ID:28] %s",gangstring,FactionInfo[28][fName]);
format(gangsstring, sizeof(gangsstring), "%s\n[ID:29] %s",gangstring,FactionInfo[29][fName]);
ShowPlayerDialog(playerid,72,0,"Gangs",gangsstring ,"I see","Ok");
%s needs to be at the beginning and as format the gangstring.
Reply
#6

Just use strcat, it's exactly the same but more efficient..
It's like having 5 bad cleaners clean your house in 3 hours, or 2 great ones that take 15 minutes. Your decision.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)