Help with DialogResponse
#1

Need a little be of help, i am currently working on a OnDialogResponse, and i have everything working, but i have it set out like this

Код:
CMD:test(playerid, params[])
}
     ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Blah", "Blah", "Select", "Close");
     return 1;
{
(this is not the real code from my script)

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(response)
        {
            switch(dialogid == 0)
           {
               case 1:
               {
                  switch(listitem)
                 {
                case 0:
               {
               ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Blah blah", "Blah blah\n", "Select", "Close");
               }
               case 1:
               {
               ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Blah blah", "Blah blah\n", "Select", "Close");
               }
               case 2:
               {
               ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Blah blah", "Blah blah\n", "Select", "Close");
               }
           }
        }
 	}
 }
(this is not the real OnDialogResponse out of my script), I wanted it so when i pressed on the DialogResponse it would do something, like lets say set a check point or something, if you know what i mean and know how to help me, please do post, i would be grateful! thank you!
Reply
#2

pawn Код:
CMD:test(playerid, params[])
}
     ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Dialog Name", "Teleport\nCheckpoint", "Select", "Close");
     return 1;
{
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
        {
            switch(dialogid == 0)
           {
               case 1:
               {
                  switch(listitem)
                 {
                case 0:
               {
                    SetPlayerPos(playerid, X, Y, Z);
               }
               case 1:
               {
                   SetPlayerCheckpoint(playerid, X, Y, Z, SIZE);
               }
           }
        }
    }
 }


public OnPlayerEnterCheckpoint(playerid)
{
    GivePlayerMoney(playerid, 1000);
    DisablePlayerCheckpoint(playerid);
    return 1;
}
Like this?
Reply
#3

No i already have a OnDialogResponse set up, i need another Response from the OnDialogResponse, if you get what i mean
Reply
#4

ik know now you want a responce for more than one dialog.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_EXAMPLE1)
    {
        if(!response) return 0;
        {
            switch(listitem)
            {
                case 0:
                {
                    // CODE HERE
                }
                case 1:
                {
                    // CODE HERE
                }
                case 2:
                {
                    // CODE HERE
                }
            }
        }
    }
   
    if(dialogid == DIALOG_EXAMPLE2)
    {
        if(!response) return 0;
        {
            switch(listitem)
            {
                case 0:
                {
                    // CODE HERE
                }
                case 1:
                {
                    // CODE HERE
                }
                case 2:
                {
                    // CODE HERE
                }
            }
        }
    }
    return 1;
}
Reply
#5

Ah, Thank you Jakwob, that worked! sorry can't rep you, i've repped you on some other topic and it says need to spread some around before i can rep you again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)