PDA

View Full Version : [HELP] Dialog with Back Button


kampuman
23/03/2015, 07:33 PM
Someone please help me with this little problem. I don't know why but when I click the Back Button from Gang Menu it doesn't do anything. It should go back from Main Menu where I can see Player Menu/Teleport Menu/Vehicle Menu etc..


switch(dialogid)
{
case DIALOG_MENU:
{
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYL E_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYL E_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
}
case 2:
{
ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYL E_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
}
case 3:
{
ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYL E_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
}
case 4:
{
ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYL E_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_STYL E_LIST,"Object Menu","Hat\nShoes \nBody","Select"," Back");
}
}
}
}
case DIALOG_CLAN_CMDS:
{
if(response)
{

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

MBilal
23/03/2015, 07:47 PM
You are using any Filterscript that have Dialogs?

kampuman
23/03/2015, 08:25 PM
You are using any Filterscript that have Dialogs?

I dont have any filterscript its all in 1 GM. Maybe theres something wrong with my script.

kampuman
24/03/2015, 04:32 PM
Anyone? please

maximthepain
24/03/2015, 10:08 PM
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..

switch(dialogid)
{
case DIALOG_MENU:
{
if(!response)
{
// Go Back
return 1;
}
if(response)
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid,DIALOG_PMENU,DIALOG_STYL E_LIST,"Player Menu","PM \n God \n Sit \n","Select"," Back");
}
case 1:
{
ShowPlayerDialog(playerid,DIALOG_TMENU,DIALOG_STYL E_LIST,"Teleport Menu","Stunts \nRace\nFun","Select","Back");
}
case 2:
{
ShowPlayerDialog(playerid,DIALOG_WMENU,DIALOG_STYL E_LIST,"Weapon Menu","Melee \nRange \nShoutguns","Select"," Back");
}
case 3:
{
ShowPlayerDialog(playerid,DIALOG_VMENU,DIALOG_STYL E_LIST,"Vehicle Menu","LowRiders\nPimp\nRacer Car","Select"," Back");
}
case 4:
{
ShowPlayerDialog(playerid,DIALOG_AMENU,DIALOG_STYL E_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_STYL E_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
}
}
}