Dialog >:(
#1

Hay, I tried to make a /color dialog, the dialog works fine, but when i click one of the options nothing happens....

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
    switch(dialogid)
        {
        case 1:
            {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerColor(playerid, invi);
                }
                case 1:
                {
                    SetPlayerColor(playerid, blue);
                }
                case 2:
                {
                    SetPlayerColor(playerid, red);
                }
            }
            }
    }
    }
    return 1;
}
Yes I added the:
pawn Код:
if(!strcmp(cmdtext, "/color", true))
    {
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What color you want?", "Invi \nBlue \nRed ", "Set", "Cancel");
    }
    return 1;
    }
Reply
#2

Try this :
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1 && response)
    {
           switch(listitem)
           {
               case 0:
               {
                    SetPlayerColor(playerid, invi);
               }
               case 1:
               {
                    SetPlayerColor(playerid, blue);
               }
               case 2:
               {
                    SetPlayerColor(playerid, red);
               }
          }    
    }
    return 1;
}
If it's still not fixed, it's a dialog conflict.
Check one of your filterscripts for dialogs or same dialog id's.
Reply
#3

Uhm... still not working... and i have no other dialogs!
Reply
#4

Try this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1 && response)
    {
        switch(listitem)
        {
            case 0:
            {
                SetPlayerColor(playerid, invi);
            }
            case 1:
            {
                SetPlayerColor(playerid, blue);
            }
            case 2:
            {
                SetPlayerColor(playerid, red);
            }
        }
        return 1;
    }
    return 0;
}
Reply
#5

why did you just return 0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)