Posts: 3,351
Threads: 780
Joined: Jan 2010
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?
Posts: 2,082
Threads: 118
Joined: Jan 2010
Reputation:
0
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.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Posts: 285
Threads: 8
Joined: Jul 2008
Reputation:
0
After the login dialog is exited, show the email dialog.
Posts: 3,351
Threads: 780
Joined: Jan 2010
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..?
Posts: 6,129
Threads: 36
Joined: Jan 2009
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.