Dialog help
#1

Hello! I'm making a RP quizz and I'm having problems with the Dialogs.

First, I use:

Код:
CMD:testquizz(playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_TEST1, DIALOG_STYLE_MSGBOX, "Roleplay Test", "{FFFFFF}Welcome to the RP Test.\n\nPlease, choose the correct answers for the {0087CC}test{FFFFFF} to verify\nthat you are a good player.", "Continue", "Cancel");
	return 1;
}
In my OnDialogResponse I have:

Код:
if(dialogid == DIALOG_TEST1)
	{
	    if(response)
        {
		    points[playerid] = 0;
		    ShowPlayerDialog(playerid, DIALOG_TEST2, DIALOG_STYLE_LIST, "First question: Test", "1\n2\n3\n4", "Next", "Exit");
	    }
	    else
	    {
	        SendClientMessage(playerid, -1, "Test cancelled");
	    }
	    return 1;
	}

if(dialogid == DIALOG_TEST2)
	{
	    if(response)
        {
		    points[playerid] += 1;
		    ShowPlayerDialog(playerid, DIALOG_TEST3, DIALOG_STYLE_LIST, "Second question: Test2", "12\n22\n32\n42", "Next", "Exit");
	    }
	    else
	    {
	        SendClientMessage(playerid, -1, "Test cancelled");
	    }
	    return 1;
	}
The problem is that DIALOG_TEST2 doesn't appears. Everytime I click Next on the first question the DIALOG_TEST1 appears again.

Any help? Thanks!
Reply
#2

Make sure that every dialog has its own unique id
The easieast way to create unique constants is with enums
PHP код:
enum {
    
DIALOG_TEST1,
    
DIALOG_TEST2

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)