DIALOG_STYLE_LIST Help
#1

Can someone give me an example to make this: DIALOG_STYLE_LIST, i'd like to make like a help dialog with a selection.
Can someone give me an example pls
Reply
#2

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/Dialog_Styles
https://sampforum.blast.hk/showthread.php?tid=379247
Reply
#3

https://sampwiki.blast.hk/wiki/How_to_Create_a_Dialog
Reply
#4

DIALOG_STYLE_LIST allows you creating a dialog with many options.
Each option is divided by "\n", that is translated by "new line".

Here's an example of a DIALOG_STYLE_LIST's dialog.

Let's define dialog's identifier:
Код:
#define DIALOG_SEX
Let's call the dialog:

Код:
public OnPlayerConnect(playerid) {
  ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_LIST, "Would you like to be a Male or Female?", "Male\nFemale");
}
Then lets see dialog's output:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  switch(dialogid) {
    case DIALOG_SEX:
    {
      switch(listitem) {
         case 0: { // 1st option
          SendClientMessage(playerid, -1, "You chose: MALE!");
         }
         case 1: { // 2nd option
           SendClientMessage(playerid, -1, "You chose: FEMALE!");
         }
      }
    }
  }
  return true;
}
You can see that listitem parameter is the item you chose.
It starts by 0.

Note: I used switch since it's more faster, but you can also do:

Код:
if(dialogid == DIALOG_SEX) {
  if(listitem == 0) {
  }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)