19.09.2010, 05:51
first make somewhere the dialog, as you have done (I think xD)
Like this:
Then, you need this: (OnDialogResponse)
Like this:
pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Something", "Option 1\r\nOption 2", "OK", "Cancel");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Sub Option 1", "Option 1\r\nOption 2", "OK", "Cancel");
case 1: ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Sub Option 2", "Option 1\r\nOption 2", "OK", "Cancel");
}
}
}
if(dialogid == 2) //Sub option 1
{
//Do something
}
if(dialogid == 3) //sub option 2
{
//Do something
}
return 1;
}