dialog back button
#1

Im having a issue with this dialog back button it wont work .

pawn Код:
if(dialogid == DIALOG_OJAIL)
    {
        if(!response) return ShowPlayerDialog(playerid, DIALOG_OJAIL, DIALOG_STYLE_LIST,""COL_WHITE"Offline Jailing",""COL_WHITE"Players Name\nJail Time\nReason","Jail","");
        {
            switch(listitem)
            {
                case 0:
                {
                    ShowPlayerDialog(playerid, DIALOG_OJAIL+1, DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the name of the player you wish to Jail.","Ok","Back");
                }
                case 1:
                {
                    ShowPlayerDialog(playerid, DIALOG_OJAIL+2, DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please specify the amount of time(in seconds) you wish to jail this player for.","Ok","Back");
                }
                case 2:
                {
                    ShowPlayerDialog(playerid, DIALOG_OJAIL+3, DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the reason why you are jailing this player.","Ok","Back");
                }
            }
        }
    }
Reply
#2

Try now


PHP код:
    if(dialogid == DIALOG_OJAIL)
    {
         if(
response)
        {
               switch(
listitem)
               {
                case 
0:
                {
                       
ShowPlayerDialog(playeridDIALOG_OJAIL+1DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the name of the player you wish to Jail.","Ok","Back");
                }
                case 
1:
                {
                    
ShowPlayerDialog(playeridDIALOG_OJAIL+2DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please specify the amount of time(in seconds) you wish to jail this player for.","Ok","Back");
                }
                case 
2:
                {
                       
ShowPlayerDialog(playeridDIALOG_OJAIL+3DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the reason why you are jailing this player.","Ok","Back");
                }
            }
            return 
1;
         }
        else return 
ShowPlayerDialog(playeridDIALOG_OJAILDIALOG_STYLE_LIST,""COL_WHITE"Offline Jailing",""COL_WHITE"Players Name\nJail Time\nReason","Jail","");
    } 
Reply
#3

Quote:
Originally Posted by ReshiramZekrom
Посмотреть сообщение
Try now


PHP код:
    if(dialogid == DIALOG_OJAIL)
    {
         if(
response)
        {
               switch(
listitem)
               {
                case 
0:
                {
                       
ShowPlayerDialog(playeridDIALOG_OJAIL+1DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the name of the player you wish to Jail.","Ok","Back");
                }
                case 
1:
                {
                    
ShowPlayerDialog(playeridDIALOG_OJAIL+2DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please specify the amount of time(in seconds) you wish to jail this player for.","Ok","Back");
                }
                case 
2:
                {
                       
ShowPlayerDialog(playeridDIALOG_OJAIL+3DIALOG_STYLE_INPUT,""COL_WHITE"Offline Jailing",""COL_WHITE"Please input the reason why you are jailing this player.","Ok","Back");
                }
            }
            return 
1;
         }
        else return 
ShowPlayerDialog(playeridDIALOG_OJAILDIALOG_STYLE_LIST,""COL_WHITE"Offline Jailing",""COL_WHITE"Players Name\nJail Time\nReason","Jail","");
    } 
This still not working
Reply
#4

Quote:

if(!response) return ShowPlayerDialog(playerid, DIALOG_OJAIL, DIALOG_STYLE_LIST,""COL_WHITE"Offline Jailing",""COL_WHITE"Players Name\nJail Time\nReason","Jail","");
{

It is more than obvious?

Put an else.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
It is more than obvious?

Put an else.
Dont think that will work but i will try
Reply
#6

Quote:
Originally Posted by 1fret
Посмотреть сообщение
Dont think that will work but i will try
response = left button
!response, otherwise else: right button
Reply
#7

Ok i added else return and the menu wont go back to the first menu any other suggestions
Reply
#8

Quote:
Originally Posted by 1fret
Посмотреть сообщение
Ok i added else return and the menu wont go back to the first menu any other suggestions
Most likely a user error (you).

response = left button
!response, otherwise else: right button
Reply
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Most likely a user error (you).

response = left button
!response, otherwise else: right button
Since you assume that im making the error show me an example of the code that your trying to tell me to do
Reply
#10

I'm assuming DIALOG_OJAIL is the first menu. The other menus are DIALOG_OJAIL + x_number, so you have to do the same starting at the if-then sentence.

if(!response) return ...
{

is wrong, by the way
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)