SA-MP Forums Archive
Dialog help please. +Rep. - 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)
+--- Thread: Dialog help please. +Rep. (/showthread.php?tid=305555)



Dialog help please. +Rep. - iGetty - 22.12.2011

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.


Re: Dialog help please. +Rep. - SchurmanCQC - 22.12.2011

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");
    }
}



Re: Dialog help please. +Rep. - iGetty - 22.12.2011

<3 Schurman! Get on TS :3


Re: Dialog help please. +Rep. - SchurmanCQC - 23.12.2011

Did it work?


Re: Dialog help please. +Rep. - iGetty - 23.12.2011

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?


Re: Dialog help please. +Rep. - SchurmanCQC - 23.12.2011

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.


Re: Dialog help please. +Rep. - Mini` - 23.12.2011

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", "");
    }
}



Re: Dialog help please. +Rep. - iGetty - 23.12.2011

I'll try that now Mini'

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

Edit: Didn't work ):


Re: Dialog help please. +Rep. - Mini` - 23.12.2011

Does the Slot 1 dialog still come up?


Re: Dialog help please. +Rep. - iGetty - 23.12.2011

It does indeed.