Posts: 547
Threads: 57
Joined: Dec 2010
Quote:
Originally Posted by HuntingMan
ShowPlayerDialog(playerid, DIALOG_EX, DIALOG_STYLE_LIST, "Choose items ","1st\n2nd\n3rd\n4th","Ok","Cancel");
pawn Код:
if(dialogid == DIALOG_EX) { if(!response) return SendClientMessage(playerid,0x0498FBC8,"Selection Cancled"); if(response) { new string[300]; new msg[200]; if(listitem == 0) { //1stitem return 1; } if(listitem == 1) { //2nd return 1; } if(listitem == 2) { //3rd return 1; } if(listitem == 3) { //4th return 1; } }
and etc
|
Doing it this way is less efficient than using cases. If you're looking for a way to shorten up the list, it depends on how it's coded. For example, if several of the options will lead to the same result, you can bundle it up as one with cases.
pawn Код:
switch(listitem)
{
//Let's say listitem 0-3 will lead to the same result
case 0..3:
{
//Whatever code you place in here will work for the first 3 options.
}
}