Showing 2 dialogs - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Showing 2 dialogs (
/showthread.php?tid=261502)
Showing 2 dialogs -
Face9000 - 13.06.2011
Hi guys,i've OnPlayerConnect and i want show 2 dialogs.
So i made this:
pawn Код:
SendClientMessage(playerid, COLOR_RED, "Your account has been detected in our database. Please log in!");
ShowPlayerDialog(playerid,60,DIALOG_STYLE_INPUT,"Login","Welcome to the server\n\nPlease enter your server password\n\nEnter a password:","Login","Quit");
continue ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "{6EF83C}Enter your email.", "Input Your Email Below", "Ok", "");
error 024: "break" or "continue" is out of context
What's wrong?
Re: Showing 2 dialogs -
Ash. - 13.06.2011
Continue should only be used in a loop to jump the code below it and move onto to the next time round. (ie, move from 0 to 1, skipping the code below it - almost like a "goto")
Also, you can't show two dialogs at the same time.
And this is just mean: This forum requires that you wait 120 seconds between posts. Please try again in
1 seconds.
Re: Showing 2 dialogs -
Face9000 - 13.06.2011
LoL,so,what i can do?
Re: Showing 2 dialogs -
PotH3Ad - 14.06.2011
After the login dialog is exited, show the email dialog.
Re: Showing 2 dialogs -
Face9000 - 14.06.2011
Quote:
Originally Posted by PotH3Ad
After the login dialog is exited, show the email dialog.
|
I don't get it,can u show me an example..?
Re: Showing 2 dialogs -
Calgon - 14.06.2011
You really should look up pages on the Wiki prior to creating a help thread.
https://sampwiki.blast.hk/wiki/OnDialogResponse
OnDialogResponse handles all dialog responses, you can't just add 2 dialogs and expect the second one to show up after the first one in some random lines of code, you need to handle the response in OnDialogResponse and in that callback, send the next dialog, so:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == 60) {
// your code for dialog 60
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "{6EF83C}Enter your email.", "Input Your Email Below", "Ok", "");
}
}
Also, the error occurs because you can't use "continue" in that way - continue is for loops and is not for general code use.