How to add a back button to a dialog? -
rangerxxll - 28.02.2013
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:
Re: How to add a back button to a dialog? -
mastermax7777 - 28.02.2013
put // before if(!response)
Re: How to add a back button to a dialog? -
MattSlater - 28.02.2013
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:
Re: How to add a back button to a dialog? -
rangerxxll - 28.02.2013
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)
{
Re: How to add a back button to a dialog? -
Scenario - 28.02.2013
I wonder why...
pawn Код:
if(dialogid == MUSIC_DIALOG2 && response)// ROCK
See the problem?
Re: How to add a back button to a dialog? -
park4bmx - 28.02.2013
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:
{
}
}
}
Re: How to add a back button to a dialog? -
rangerxxll - 28.02.2013
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.
Re: How to add a back button to a dialog? -
Scenario - 28.02.2013
You have this:
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)
Re: How to add a back button to a dialog? -
rangerxxll - 28.02.2013
I see. I thought the && response meant if the first button was clicked it would proceed to the dialog. Thank you, greatly appreciated.