ondialogresponse, little problem..
#1

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 5001)
    {
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 
1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }
        }
        if(!
response) return 0;
    }
    return 
0;

When dialogid 5001 is open, it show me the list.. but when i choise one of the options don't do nothing.. why? I have declared the switch(listitem) and it don't take consideration of lines that follows.

Help.
Reply
#2

Nobody know the solution ?!
Reply
#3

Try this, I think it needs a return value:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) 
{ 
    if(dialogid == 5001) 
    { 
        if(response) 
        { 
            switch(listitem) 
            { 
                case 0: ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit"); 
                case 1: ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit"); 
            } 
            return 1;
        } 
        if(!response) return 0; 
    } 
    return 0; 
}
Also, you should change "ammount" to "amount".
Reply
#4

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }
        }
        else if(!response) return 0;
    }
    return 0;
}
Reply
#5

Doesn't work bro.. з_з
Reply
#6

Quote:
Originally Posted by Isolated
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }
        }
        else if(!response) return 0;
    }
    return 0;
}
doesn't works з_з
Reply
#7

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }return 1;

        }
        else if(!response) return 0;
    }
    return 0;
}
Reply
#8

Quote:
Originally Posted by Isolated
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }return 1;

        }
        else if(!response) return 0;
    }
    return 0;
}
doesn't works bro з_з
Reply
#9

Using any filterscript which is having the same dialogid as this one? Try the code below tho:

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0: ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1: ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }
            return 1;
        }
    }
    return 0;
}
Reply
#10

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 5001)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:    ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Deposit","Type ammount of money you want deposit in your house","Done!","Quit");
                case 1:    ShowPlayerDialog(playerid,5020,DIALOG_STYLE_INPUT,"Withdraw","Type ammount of money you want withdraw from your house","Done!","Quit");
            }
        }
        if(!response) return 0;
    }
    return 1;
}
If this is also not working then remove if(!response) return 0; from my codes and try again!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)