Showing 2 dialogs
#1

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?
Reply
#2

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.
Reply
#3

LoL,so,what i can do?
Reply
#4

After the login dialog is exited, show the email dialog.
Reply
#5

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..?
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)