SA-MP Forums Archive
[Help] Dialog doubt - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Dialog doubt (/showthread.php?tid=147514)



[Help] Dialog doubt - Coldthug - 12.05.2010

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



Re: [Help] Dialog doubt - Zimon95 - 12.05.2010

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


Re: [Help] Dialog doubt - Coldthug - 12.05.2010

It doesn't work that way.

Edit: Anyone?


Re: [Help] Dialog doubt - ViruZZzZ_ChiLLL - 13.05.2010

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


Re: [Help] Dialog doubt - RyDeR` - 13.05.2010

I use it like this: »

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



Re: [Help] Dialog doubt - Coldthug - 13.05.2010

So how would it stay?


Re: [Help] Dialog doubt - ViruZZzZ_ChiLLL - 13.05.2010

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


Re: [Help] Dialog doubt - Coldthug - 13.05.2010

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.