ShowPlayerDialog too long
#1

Hey.
I make many menus using GUI. But, sometimes I got errors, because it's too long (ShowPlayerDialog in one line). I started making "Part 2", "Part 3", etc... Can anyone tell me easiest way to make menus longer (use #define?) without making parts in other menus?

Thanks
Reply
#2

On top of ur script:
pawn Code:
new LongDialog [ 1024 ];
OnGameModeInit/OnFilterScriptInit:
pawn Code:
SetUpMyText();
Command:
pawn Code:
ShowPlayerDialog(playerid, 555555, DIALOG_STYLE_MSGBOX,"Dialog Title",LongDialog, "button 1", "button 2");
Somewhere in ur script
pawn Code:
SetUpMyText()
{
    LongDialog = "Bla bla bal\n";
    strcat(LongDialog, "Bla bla bal\n");
    strcat(LongDialog, "Bla bla bal\n");
    strcat(LongDialog, "Bla bla bal\n");
    strcat(LongDialog, "Bla bla bal\n");
    return 1;
)
Reply
#3

^ No.

@OP:

pawn Code:
ShowPlayerDialog( playerid, Dialog:ID, DIALOG_STYLE_LIST, "Title", "Long text, too long for the compiler \
to process."
, "Submit", "Cancel" );
You use a \ and go to the next line.
Reply
#4

Thanks, works

Here is a beer for you
Reply
#5

Sorry, but I still have a problem (the same).

Here's the script:

Code:
dcmd_cmds(playerid,params[])
{
 	#pragma unused params
 	ShowPlayerDialog(playerid, MENU+1, DIALOG_STYLE_LIST,"{0000FF}List of commands","{FFFF00}/rules\t\t\t {FFFFFF}Show server rules\
	\n{FFFF00}/menu\t\t\t {FFFFFF}Show map list menu\
	\n{FFFF00}/deleteobjects\t\t {FFFFFF}Delete all loaded objects\
	\n{FFFF00}/info\t\t\t {FFFFFF}Show information about the server\
	\n{FFFF00}/home\t\t\t {FFFFFF}Teleport back to spawnpoint\
	\n{FFFF00}/vehicle\t\t {FFFFFF}Spawn a vehicle\
	\n{FFFF00}/website\t\t {FFFFFF}Show server website\
	\n{FFFF00}/sounds\t\t {FFFFFF}Show list of sounds\
	\n{FFFF00}/ho\t\t\t {FFFFFF}Holding object list\
	\n{FF0000}Part 2","Select","Cancel");
	return 1;
}
Errors:

...\Gamemode.pwn(31 : error 075: input line too long (after substitutions)
...\Gamemode.pwn(319) : error 037: invalid string (possibly non-terminated string)
...\gamemodes\Gamemode.pwn(319) : error 017: undefined symbol "FFFF00"
...\gamemodes\Gamemode.pwn(319) : error 029: invalid expression, assumed zero
...\gamemodes\Gamemode.pwn(319) : fatal error 107: too many error messages on one line

It's the same problem like making a long dialog in one line.

Help?
Reply
#6

Quote:
Originally Posted by Libra_PL
View Post
Sorry, but I still have a problem (the same).

Here's the script:

Code:
dcmd_cmds(playerid,params[])
{
 	#pragma unused params
 	ShowPlayerDialog(playerid, MENU+1, DIALOG_STYLE_LIST,"{0000FF}List of commands","{FFFF00}/rules\t\t\t {FFFFFF}Show server rules\
	\n{FFFF00}/menu\t\t\t {FFFFFF}Show map list menu\
	\n{FFFF00}/deleteobjects\t\t {FFFFFF}Delete all loaded objects\
	\n{FFFF00}/info\t\t\t {FFFFFF}Show information about the server\
	\n{FFFF00}/home\t\t\t {FFFFFF}Teleport back to spawnpoint\
	\n{FFFF00}/vehicle\t\t {FFFFFF}Spawn a vehicle\
	\n{FFFF00}/website\t\t {FFFFFF}Show server website\
	\n{FFFF00}/sounds\t\t {FFFFFF}Show list of sounds\
	\n{FFFF00}/ho\t\t\t {FFFFFF}Holding object list\
	\n{FF0000}Part 2","Select","Cancel");
	return 1;
}
Errors:

...\Gamemode.pwn(31 : error 075: input line too long (after substitutions)
...\Gamemode.pwn(319) : error 037: invalid string (possibly non-terminated string)
...\gamemodes\Gamemode.pwn(319) : error 017: undefined symbol "FFFF00"
...\gamemodes\Gamemode.pwn(319) : error 029: invalid expression, assumed zero
...\gamemodes\Gamemode.pwn(319) : fatal error 107: too many error messages on one line

It's the same problem like making a long dialog in one line.

Help?
Do what Clive told you JamesC seems he has no clue.
Reply
#7

And Clive's idea doesn't work for me. It just ruins all my stocks (ex. SendMessageToAdmins). If I put under all these stocks, I get this:

...\Gamemode.pwn(10543) : warning 225: unreachable code
...\Gamemode.pwn(10543) : error 029: invalid expression, assumed zero
...\Gamemode.pwn(10543 -- 1057 : warning 215: expression has no effect
...\Gamemode.pwn(1057 : error 001: expected token: ";", but found "-end of file-"
Reply
#8

You've wrote it wrong. Check for missing ';', misplaced 'return's etc.
Reply
#9

I don't know what's wrong... Before all worked perfectly, 0 problems.

But here's all what did I do about this:

On top:
Code:
new AnimationsDialog [1024];
Command:
Code:
dcmd_animlist(playerid,params[])
{
 	#pragma unused params
 	ShowPlayerDialog(playerid, MENU+2, DIALOG_STYLE_MSGBOX,"{0000FF}List of animations",AnimationsDialog, "Close", "");
	return 1;
}
OnPlayerCommandText:
Code:
dcmd(animlist,8,cmdtext);
OnGameModeInit:

Code:
DialogText();
Under all stocks:

Code:
DialogText()
{
    AnimationsDialog = "/serve - /lay - /rollfall - /bomb - /basket\n";
    strcat(AnimationsDialog, "/camera - /feelbad - /waterjump - /eat\n");
    strcat(AnimationsDialog, "/vomit - /flowers - /monkey - /knife\n");
    strcat(AnimationsDialog, "/wave - /kiss - /spraycan - /chant - /shout\n");
    strcat(AnimationsDialog, "/sword - /skate - /wuzi - /dealstance\n");
    strcat(AnimationsDialog, "/drink - /dance - /slap - /sex - /smoke\n");
    strcat(AnimationsDialog, "/sad - /security - /lookout - /yeah - /talk\n");
    strcat(AnimationsDialog, "/facepalm - /sup - /no - /yes - /bye - /kick\n");
    strcat(AnimationsDialog, "/fall - /lifejump - /fu - /omg - /handsup\n");
    strcat(AnimationsDialog, "/taxi - /walk - /die - /drunk - /woman");
    return 1;
)
PS: Changing names like from LongDialog to AnimationsDialog shouldn't make errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)