[HELP] Dialog with Back Button
#5

if(!response) You show the old dialog
if(response) You show the new dialog
Think about continuous dialog, when you click Select it will use the response, however when you click Back it will use !response, there should be the code for going back to any dialog..
pawn Код:
switch(dialogid)
{
    case DIALOG_MENU:
    {
        if(!response)
        {
            // Go Back
            return 1;
        }
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYLE_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
                }
                case 1:
                {
                    ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYLE_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
                }
                case 2:
                {
                    ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYLE_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
                }
                case 3:
                {
                    ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYLE_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
                }
                case 4:
                {
                    ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYLE_LIST,"Animation Menu","Sit \nSleep \nDrunk \nTalk","Select"," Back");
                }
                case 5:
                {
                    new str[700];
                    strcat(str, ""YELLOW"/cgang         "WHITE"-  Creates a gang \n");
                    strcat(str, ""YELLOW"/ginvite        "WHITE"-  Invite a member to your gang \n");
                    strcat(str, ""YELLOW"/jgang           "WHITE"-  Accept a clan invitation request \n");
                    strcat(str, ""YELLOW"/dgang        "WHITE"-  Deny a clan invitation request \n");
                    strcat(str, ""YELLOW"/gsetrank     "WHITE"-  Set a clan member's rank/position \n");
                    strcat(str, ""YELLOW"/granks        "WHITE"-  View the list of member ranks \n");
                    strcat(str, ""YELLOW"/gmembers  "WHITE"-  View your online gang members \n");
                    strcat(str, ""YELLOW"/g                  "WHITE"-  Talk in the gang chat \n");
                    strcat(str, ""YELLOW"/gclose         "WHITE"-  Disband a gang \n");
                    ShowPlayerDialog(playerid, DIALOG_CLAN_CMDS, DIALOG_STYLE_LIST, ""GOLD"Gang Menu", str, "Select", "Back");
                }
                case 6:
                {
                    ShowPlayerDialog(playerid,DIALOG_OMENU,DIALOG_STYLE_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
                }
            }
        }
    }
    case DIALOG_CLAN_CMDS:
    {
        if(!response)
        {
            new str[700];
            strcat(str, ""YELLOW"Player Menu      "WHITE"-  View the list of Player commands \n");
            strcat(str, ""YELLOW"Teleport Menu  "WHITE"-  View the list of Teleport commands \n");
            strcat(str, ""YELLOW"Weapon Menu   "WHITE"-  View the list of Weapon commands \n");
            strcat(str, ""YELLOW"Vehicle Menu   "WHITE"-  View the list of Vehicle commands \n");
            strcat(str, ""YELLOW"Gang Menu       "WHITE"-  View the list of Gang commands \n");
            strcat(str, ""YELLOW"Object Menu     "WHITE"-  View the list of Attach Object commands \n");
            ShowPlayerDialog(playerid, DIALOG_MENU, DIALOG_STYLE_LIST, ""GOLD"Main Commands", str, "Select", "Close");
            return 1;
        }
        if(response)
        {
            //Next Code
        }
    }
}
Reply


Messages In This Thread
[HELP] Dialog with Back Button - by kampuman - 23.03.2015, 19:33
Re: [HELP] Dialog with Back Button - by MBilal - 23.03.2015, 19:47
Re: [HELP] Dialog with Back Button - by kampuman - 23.03.2015, 20:25
Re: [HELP] Dialog with Back Button - by kampuman - 24.03.2015, 16:32
Re: [HELP] Dialog with Back Button - by maximthepain - 24.03.2015, 22:08

Forum Jump:


Users browsing this thread: 4 Guest(s)