[Help] Dialog doubt
#1

Well i can't get how to make the "Back" button return to:
pawn Код:
ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_LIST, "Help","Account\nCommands\nRules\nCredits", "Select", "Cancel");
My code:
pawn Код:
if(strcmp(cmd, "/help", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_LIST, "Help","Account\nCommands\nRules\nCredits", "Select", "Cancel");
        }
        return 1;
    }

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1338)
    {
        if(response)
        {
            if(listitem == 0)
            {
                ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_MSGBOX, "Account","Account related stuff here", "Back", "Cancel");
            }
            if(listitem == 1)
            {
                ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_MSGBOX, "Commands","Command shown here", "Back", "Cancel");
            }
            if(listitem == 2)
            {
                ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_MSGBOX, "Rules","Server rules shown here", "Back", "Cancel");
            }
            if(listitem == 3)
            {
                ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_MSGBOX, "Credits","Credits here", "Back", "Cancel");
            }
        }
    }
    return 0;
}
Reply
#2

pawn Код:
if(response)
{
   //Stuff Here
}
else ShowPlayerDialog(playerid, HELP, DIALOG_STYLE_LIST, "Help","Account\nCommands\nRules\nCredits", "Select", "Cancel");
Not tested.
Reply
#3

It doesn't work that way.

Edit: Anyone?
Reply
#4

it would be fast and easy if you did this
pawn Код:
if(dialogid == HELP && !response) //(!response means it would make a response for the 2nd button)
{
// Do something here
}
For short (response) responds to the first button
(!response) responds to the second button
Reply
#5

I use it like this: »

if(!response) return ShowPlayerDialog(playerid, ...) // the previous dialog id
// your code here
Reply
#6

So how would it stay?
Reply
#7

Quote:
Originally Posted by Coldthug
So how would it stay?
what do you mean, "So how would it stay"?
Reply
#8

How to do it like the way you said, i did:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1338 && response)
{

But it doesn't worked that way.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)