07.07.2016, 21:41
Hi. Reading the model id is similar to how you read listitems from other dialog styles. You create the list so you should know which listitem belongs to which model id.
For example:
For example:
pawn Код:
new models[] = {0, 1, 2};
new labels[][] = {"item1", "item2", "item3"};
// Show dialog to player
ShowPlayerPreviewModelDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "Dialog:", models, labels, "Button1", "Button2");
// Response
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 0)
{
if (response)
{
new str[45];
format(str, sizeof (str), "Listitem: %i, Modelid: %i", listitem, models[listitem]);
SendClientMessage(playerid,-1, str);
}
}
}