How to add a back button to a dialog?
#1

I've tried scripting a back button, but I'm unsure of why its not working.

pawn Код:
if(!response) return ShowPlayerDialog(playerid,MUSIC_DIALOG,DIALOG_STYLE_LIST, "Track Selection","Rock\nMetal\nHip Hop\nDubstep","Select","Cancel");
Any help is appreciated. Thank you.

Extra code:
pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
    {
        switch(listitem)
        {
               if(!response) return ShowPlayerDialog(playerid,MUSIC_DIALOG,DIALOG_STYLE_LIST, "Track Selection","Rock\nMetal\nHip Hop\nDubstep","Select","Cancel");
            case 0:
Reply
#2

put // before if(!response)
Reply
#3

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
put // before if(!response)
Lol, don't listen to this guy.

pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
    {
               if(!response) return ShowPlayerDialog(playerid,MUSIC_DIALOG,DIALOG_STYLE_LIST, "Track Selection","Rock\nMetal\nHip Hop\nDubstep","Select","Cancel");

         switch(listitem)
        {

            case 0:
Reply
#4

It's still not working.

pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
    {
        if(!response) return ShowPlayerDialog(playerid,MUSIC_DIALOG,DIALOG_STYLE_LIST, "Track Selection","Rock\nMetal\nHip Hop\nDubstep","Select","Cancel");
        switch(listitem)
        {
Reply
#5

I wonder why...

pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
See the problem?
Reply
#6

This is wrong from whereever u look at it
pawn Код:
if(dialogid == MUSIC_DIALOG)
   {
        if(!response) return ShowPlayerDialog(playerid,MUSIC_DIALOG,DIALOG_STYLE_LIST, "Track Selection","Rock\nMetal\nHip Hop\nDubstep","Select","Back");
        switch(listitem)
        {
             case 0:
             {
             }
        }
   }
Reply
#7

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I wonder why...

pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
See the problem?
Not really. That's why I'm asking here.

Would it be something like this?
pawn Код:
if(dialogid == MUSIC_DIALOG2 && !response) return ShowPlayerDialog
? I've never really been good with dialogs, so please forgive me.
Reply
#8

You have this:

pawn Код:
&& response
Which is checking to see if dialogid == MUSIC_DIALOG2 AND that the first button was clicked.

However, you then go on to see if the first button was NOT clicked- you can't do that, because the code underneath the if statement will only run IF the first button WAS clicked.

So, this:

pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)
Should be:

pawn Код:
if(dialogid == MUSIC_DIALOG2)
Reply
#9

I see. I thought the && response meant if the first button was clicked it would proceed to the dialog. Thank you, greatly appreciated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)