[SOLVED] Dialog Doesnt Work !
#1

Well heres my problem ! i checked the code and cant find it i Chose maybe KICK and it gives me BAN witch is before kick .

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == //privacy security)
    {
      if (response == 1)
      {
            switch(listitem)
            {
              case 1: ShowPlayerDialog(playerid,89,DIALOG_STYLE_INPUT,"Ban Someone","Reason (optional) :","Accept","Denied");
              case 2: ShowPlayerDialog(playerid,57,DIALOG_STYLE_INPUT,"Kick Someone","Reason (optional) :","Accept","Denied");
              case 3: ShowPlayerDialog(playerid,67,DIALOG_STYLE_INPUT,"Jail Someone","Reason (optional) :","Accept","Denied");
              case 4: ShowPlayerDialog(playerid,55,DIALOG_STYLE_INPUT,"Mute Someone","Reason (optional) :","Accept","Denied");
              case 5: ShowPlayerDialog(playerid,50,DIALOG_STYLE_INPUT,"Admin PM : ","Enter ADMIN PM Text : ","Send","Cancel");
              case 6: ShowPlayerDialog(playerid,45,DIALOG_STYLE_INPUT,"Take Cash $$$","How Much To Take (-$$$) : ","Take $$$","Cancel");
            }
      }
    }
    if (dialogid == 89 && response == 1)
    {
// my code
    if (dialogid == 67 && response == 1)
    {
// my code
          else
// my code
    }
    if (dialogid == 55 && response == 1)
    {
// my code
      }
    }
    if (dialogid == 50 && response == 1)
    {
// my code
    }
    return 1;
}
i had to cover those with // my code and // privacy security in case someone wants to steal my idea . Sorry . but when i chose the last dialog ( 50 ) it gives me the codes of the one before ( ID : 67 )
Reply
#2

listitem starts at 0, not 1
Reply
#3

"listitem" starts with the ID 0. So
pawn Код:
case 0: ShowPlayerDialog(playerid,89,DIALOG_STYLE_INPUT,"Ban Someone","Reason (optional) :","Accept","Denied");
  case 1: ShowPlayerDialog(playerid,57,DIALOG_STYLE_INPUT,"Kick Someone","Reason (optional) :","Accept","Denied");
  case 2: ShowPlayerDialog(playerid,67,DIALOG_STYLE_INPUT,"Jail Someone","Reason (optional) :","Accept","Denied");
  case 3: ShowPlayerDialog(playerid,55,DIALOG_STYLE_INPUT,"Mute Someone","Reason (optional) :","Accept","Denied");
  case 4: ShowPlayerDialog(playerid,50,DIALOG_STYLE_INPUT,"Admin PM : ","Enter ADMIN PM Text : ","Send","Cancel");
  case 5: ShowPlayerDialog(playerid,45,DIALOG_STYLE_INPUT,"Take Cash $$$","How Much To Take (-$$$) : ","Take $$$","Cancel");
Reply
#4

Quote:
Originally Posted by _Xerxes_
"listitem" starts with the ID 0. So
pawn Код:
case 0: ShowPlayerDialog(playerid,89,DIALOG_STYLE_INPUT,"Ban Someone","Reason (optional) :","Accept","Denied");
  case 1: ShowPlayerDialog(playerid,57,DIALOG_STYLE_INPUT,"Kick Someone","Reason (optional) :","Accept","Denied");
  case 2: ShowPlayerDialog(playerid,67,DIALOG_STYLE_INPUT,"Jail Someone","Reason (optional) :","Accept","Denied");
  case 3: ShowPlayerDialog(playerid,55,DIALOG_STYLE_INPUT,"Mute Someone","Reason (optional) :","Accept","Denied");
  case 4: ShowPlayerDialog(playerid,50,DIALOG_STYLE_INPUT,"Admin PM : ","Enter ADMIN PM Text : ","Send","Cancel");
  case 5: ShowPlayerDialog(playerid,45,DIALOG_STYLE_INPUT,"Take Cash $$$","How Much To Take (-$$$) : ","Take $$$","Cancel");
LOL that was easy ....well il test it now .
Reply


Forum Jump:


Users browsing this thread: