16.04.2018, 18:25
PHP код:
// 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");
}
}
}