Creating a looong MsgBox
#1

So as the title, i tried several ways to get a looong msg box. but always get the "Input too long after substitution" error

I seen several servers using long msg box, for example- the ones in gamerx.

So yeah, i was wondering how it should be done. Thanx
Reply
#2

Message box as?

you mean dialogs?
Reply
#3

Ofc, sorry if y'all didn't get that ;P
Reply
#4

"Input too long after substitution" is pawno wise, just go somewhere in the middle of the line and press enter, it will work.
Reply
#5

You'll have to merge several smaller strings to make a longer one.

pawn Код:
new
    myLongString[2048] = "This is the first half of my string. It's quite long. ";

strcat(myLongString, "We can make it longer by adding to the string at ");
strcat(myLongString, "runtime. That's pretty cool nifty huh? It would be ");
strcat(myLongString, "nicer if we could do this before compiling, but oh ");
strcat(myLongString, "well. Please note this is all on one line. There are ");
strcat(myLongString, "no newline characters present in the strings.");

print(myLongString); // Print it just incase the ShowPlayerDialog doesn't work.
ShowPlayerDialog(playerid, 7331, DIALOG_STYLE_MSGBOX, "Test", myLongString, "OK", "NOT OK");
I'm not sure if ShowPlayerDialog will show a dialog this wide, however the theory behind making a long string using strcat should work.
Reply
#6

Great its work!
Reply
#7

Quote:
Originally Posted by HotPlayer
Посмотреть сообщение
Great its work!
Can I give you some negative rep for spamming like a beech?
Reply
#8

Quote:
Originally Posted by HotPlayer
Посмотреть сообщение
Great its work!
Lmao.
Please don't bump old sloved topic's, look at the dates..
Reply
#9

On top:

pawn Код:
new LongDialog [1024];
OnGameModeInit

pawn Код:
SetUpMyText();
Example cmd for long dialog:

pawn Код:
CMD:longdialog(playerid, params[])
{
    ShowPlayerDialog(playerid,69333, DIALOG_STYLE_MSGBOX,"Long Dialog.",LongDialog, "Okay", "Exit");
    return 1;
}
And anywhere in script:

pawn Код:
SetUpMyText()
{
    LongDialog = "Bla bla bla \n";
    strcat(LongDialog, "Bla bla.\n");
    strcat(LongDialog, "Bla bla.\n");
    return 1;
}
You can go on with long dialogs on strcat.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)