Dialog help please. +Rep.
#1

I have a little problem with DIALOG_STYLE_MSGBOX.

I have this code:

pawn Код:
case 356:
{
    if(!response)
    {
        //next dialog
        ShowPlayerDialog(playerid, 345, DIALOG_STYLE_MSGBOX, "Test", "Test", "Test", "");
        return 1;
    }
    else
    {
        ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "{33FF33}Clover", "Slot 1\nSlot 2\nSlot 3", "Select", "Cancel");
    }
}
and a command

pawn Код:
command(buycar, playerid, params[])
{
    ShowPlayerDialog(playerid, 356, DIALOG_STYLE_MSGBOX, "Micks Motors", "Clover\nTo buy this clover press OK. To see the next vehicle, press NEXT.", "OK", "Next");
}
When I do the command, the dialog shows. When I press "OK" (Left button), it comes up with the dialog saying "Slot 1\nSlot 2\nSlot 3" as it should, but when I press "Next", nothing happens? Instead of going on to the next Dialog, the box just closes.. All help is appreciated.
Reply
#2

pawn Код:
case 356:
{
    if(response == 0)
    {
        //next dialog
        ShowPlayerDialog(playerid, 746, DIALOG_STYLE_MSGBOX, "Test", "Test", "Test", "");//try a different dialog id, I just randomly put this one
    }
    if(response == 1)
    {
        ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "{33FF33}Clover", "Slot 1\nSlot 2\nSlot 3", "Select", "Cancel");
    }
}
Reply
#3

<3 Schurman! Get on TS :3
Reply
#4

Did it work?
Reply
#5

Nope. I did this:

pawn Код:
case 346:
{
    if(response == 0)
    {
        print("sda");
        ShowPlayerDialog(playerid, 345, DIALOG_STYLE_MSGBOX, "Test", "Test", "Test", "Test");
        print("sda");
    }
    if(response == 1)
    {
        ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "{33FF33}Clover", "Slot 1\nSlot 2\nSlot 3", "Select", "Cancel");
    }
}
When I did the command, there was no print in the console. What could be wrong?
Reply
#6

I tried testing all of the code and for some reason I couldn't compile, and there was no errors in the code, although it said there were in the compilation box.
Reply
#7

I don't quite get why your first code didn't work? Would it help if you reversed it? Instead of if(!response) -> else
then use if(response) -> else if (!response)

Just an idea. Like I said, I don't see why it wouldn't work... It makes sense.

Like so...

Код:
case 356:
{
    if(response)
    {
		ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "{33FF33}Clover", "Slot 1\nSlot 2\nSlot 3", "Select", "Cancel");
        return 1;
    }
    else if(!response)
    {
		//next dialog
		ShowPlayerDialog(playerid, 345, DIALOG_STYLE_MSGBOX, "Test", "Test", "Test", "");
    }
}
Reply
#8

I'll try that now Mini'

I will edit this post to notify you of the outcome.

Edit: Didn't work ):
Reply
#9

Does the Slot 1 dialog still come up?
Reply
#10

It does indeed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)