Qustion for ShowPlayerDialog
#1

ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Title","title1\ntitle2\ntitle3","Buy","Other" );

I want by clicking on the "Other" and shows me another Dialog

This is "other":
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Title2","title4\ntitle5\ntitle6","Buy","Cance l");
Reply
#2

Check if there is no response IE,
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 0:
        {
            if(response)
            {
            }
            else//second button pressed or dialog cancelled.
            {
                //your stuff here
            }
        }
    }
    return 1;
}
If there is a response the first button (or a listitem) was pressed, otherwise button 2 has been pressed or the dialog cancelled.
Reply
#3

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 0:
        {
            if(response)
            {
                        if(listitem == 0)
                        {
                              //..
                        }
            }
            else//second button pressed or dialog cancelled.
            {
                  ShowPlayerDialog(....);       
            }
        }
    }
    return 1;
}
so?
Reply
#4

That should do it.
Reply
#5

Can you do an example
Reply
#6

pawn Код:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Title","title1\ntitle2\ntitle3","Buy","Other" );

public OnPlayerDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 0:
        {
            if(response)
            {
                if(listitem == 0)
                {
                    SendClientMessage(playerid,0xFF0000FF,"title1");
                }
                if(listitem == 1)
                {
                    SendClientMessage(playerid,0xFF0000FF,"title2");
                }
                if(listitem == 2)
                {
                    SendClientMessage(playerid,0xFF0000FF,"title3");
                }
            }
            else
            {
                  ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Title2","title4\ntitle5\ntitle6","Buy","Cance l");  
            }
        }
    }
    return 1;
}
Reply
#7

Doesn't working
Reply
#8

AeroBlast was quite close, only the case 0 was wrong checked (for dialogid 1):
Код:
public OnPlayerDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
		case 1:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
						SendClientMessage(playerid,0xFF0000FF,"title1");
					}
					case 1:
					{
						SendClientMessage(playerid,0xFF0000FF,"title2");
					}
					case 2:
					{
						SendClientMessage(playerid,0xFF0000FF,"title3");
					}
				}
			}
			else
			{
				ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Title2","title4\ntitle5\ntitle6","Buy","Cancel");  
			}
		}
		case 2:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
						SendClientMessage(playerid,0xFF0000FF,"title4");
					}
					case 1:
					{
						SendClientMessage(playerid,0xFF0000FF,"title5");
					}
					case 2:
					{
						SendClientMessage(playerid,0xFF0000FF,"title6");
					}
				}
			}
			else
			{
				ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Title1","title1\ntitle2\ntitle3","Buy","Back");  
			}
		}
	}
	return 1;
}
Reply
#9

Thanks bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)