ocmd:navi(playerid,params[]) { ShowPlayerDialog(playerid, DIALOG_NAVI1, DIALOG_STYLE_LIST, "Navigationssystem", "•List 1\n•List 2\nList 3", "Choose this", "cancel"); return 1; }
if(dialogid == DIALOG_NAVI1) switch(listitem) { case 0: { ShowPlayerDialog(playerid, DIALOG_NAVI2, DIALOG_STYLE_LIST, "Navigationssystem", "•alist1\n•alist2\n•alist3", "choose", "cancel"); } case 1: { } case 2: { } case 3: { } }
case DIALOG_NAVI1: { if(response) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, DIALOG_NAVI2, DIALOG_STYLE_LIST, "Navigationssystem", "•alist1\n•alist2\n•alist3", "choose", "cancel"); } case 1: { } case 2: { } case 3: { } } } }
Anytime, instead of DIALOG_NAVI2 you can also you DIALOG_NAVI+1, DIALOG_NAVI+2 and so on for ez life!
|
#define dialog 1000 if(dialogid == dialog) if(dialogid == dialog+1) if(dialogid == dialog+2)
// Make sure to define each dialog with a unique number
#define DIALOG_NAVI1 1
#define DIALOG_NAVI2 2
ocmd:navi(playerid,params[])
{
ShowPlayerDialog(playerid, DIALOG_NAVI1, DIALOG_STYLE_LIST, "Navigation system", "•List 1\n•List 2\n•List 3", "Choose", "Cancel");
return 1;
}
// OnDialogResponse
if(dialogid == DIALOG_NAVI1)
{
if(response) // if user selected something
{
switch(listitem)
{
case 0: // User has selected the 1st item in list from DIALOG_NAVI1
{
ShowPlayerDialog(playerid, DIALOG_NAVI2, DIALOG_STYLE_LIST, "Navigation system", "•alist1\n•alist2\n•alist3", "Choose", "Cancel");
}
case 1: // User has selected the 2nd item in list from DIALOG_NAVI1
{
// do something
}
case 2: // User has selected the 3rd item in list from DIALOG_NAVI1
{
// do something
}
}
}
}
if(dialogid == DIALOG_NAVI2)
{
if(response)
{
switch(listitem)
{
case 0: SendClientMessage(playerid, -1, "1. item selected");
case 1: SendClientMessage(playerid, -1, "2. item selected");
case 2: SendClientMessage(playerid, -1, "3. item selected");
}
}
}