21.01.2011, 11:39
pawn Код:
// EXAMPLE SCRIPT
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"What is it that you want?","Beer\r\nWine\r\nVodka","OK","Cancel");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==1) // The ID is 1
{
if(response) // response = If player clicks the first button (in this case It is "OK")
{
if(listitem==0)
{
// If player choose Beer
}
else if(listitem==1)
{
// If Player Choose Wine
}
else if(listitem==2)
{
// If player choose Vodka
}
}
else if(!response) // !response = If player clicks the second button (in this case It is "Cancel")
{
// If you want the dialog to appear again when player clicks Cancel just put the ShowPlayerDialog line inside here
}
}
return 1;
}