16.04.2015, 14:31
Oh..you mean the listitem?
If the dialog is a list type, the value of 'listitem' in OnDialogResponse is the item's position in dialog - 1 .
The items in the list starts from 0.
Example:
The value of 'listitem' is determined by the item which the player has selected.
If the dialog is a list type, the value of 'listitem' in OnDialogResponse is the item's position in dialog - 1 .
The items in the list starts from 0.
Example:
PHP код:
CMD:cmds(playerid, params[]) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Commands", "General Commands\nPlayer Commands", "Select", "Close");
public OnDialogReponse(playerid, dialogid, response, listitem)
{
if(listitem==0) //show the dialog of general commands
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "General commands", "These are the general commands", "Back", "Close");
}
if(listitem==1) // show the dialog of player commands
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Player commands", "These are the player commands", "Back", "Close");
}
return 1;
}