OnDialogResponse problem
#1

Hi,

I have a problem with my dialogs:nothing happens when I click any option.

I used
pawn Код:
printf("OnDialogResponse(%d, %d, %d, %d, \"%s\")", playerid, dialogid, response, listitem, inputtext);
In the first line of OnDialogResponse and it doesn't work(doesn't print anything in the console).

I checked dialogids and everything but it just won't work.Do you have an explanation for this?
Reply
#2

If youre using it in a filterscript, the callback should return 0.
pawn Код:
public OnDialogResposne(....)
{
    return 0;
}
Reply
#3

I'm not using it in a filterscript
Reply
#4

Then show the part where its going wrong
Reply
#5

Everything is wrong.I used a print after if(dialogid == 1) and it doesn't even show up.
Reply
#6

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Then show the part where its going wrong
---^
Reply
#7

pawn Код:
//command
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Test", "Test\r\nTest2", "Ok", "Close");
//OnDialogResponse
if(dialogid == 1)
{
    if(response)
    {
         if(listitem == 0)
         {
              ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Test11", "Test111test111string", "Ok", "Cancel");
          }
          if(listitem == 1)
         {
              ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Test11", "Test111tasdaest111string", "Ok", "Cancel");
          }
    }
}
It just shows the first dialog when i execute the command and then if i click an option nothing happens.This also happens with other dialogs.The printf returns nothing(Nothing is printed in the server console)
Reply
#8

I also have other dialogs and those work.I don't know what is wrong with this one.I tried to change it's position in the script but it's the same, it doesn't even return the dialogid, inputtext, etc. in the printf.Does anyone have a solution?
Reply
#9

Anyone knows how to solve this, please?
Reply
#10

Quote:
Originally Posted by Yvax
Посмотреть сообщение
pawn Код:
//command
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Test", "Test\r\nTest2", "Ok", "Close");
//OnDialogResponse
if(dialogid == 1)
{
    if(response)
    {
         if(listitem == 0)
         {
              ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Test11", "Test111test111string", "Ok", "Cancel");
          }
          if(listitem == 1)
         {
              ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Test11", "Test111tasdaest111string", "Ok", "Cancel");
          }
    }
}
It just shows the first dialog when i execute the command and then if i click an option nothing happens.This also happens with other dialogs.The printf returns nothing(Nothing is printed in the server console)
Commands aren't with Dialogs
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/command", true))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Test", "Test\nTest2", "Select", "Cancel");
        return 1;
    }
    return 0;
}
And if you are using it on gamemode
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Test11", "Test111test111string", "Ok", "Cancel");
            }
            if(listitem == 1) {
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Test11", "Test111tasdaest111string", "Ok", "Cancel");
            }
        }
    }
    //More
    return 1;
}
If else on FS
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        if(response) {
            if(listitem == 0) {
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Test11", "Test111test111string", "Ok", "Cancel");
            }
            if(listitem == 1) {
                ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "Test11", "Test111tasdaest111string", "Ok", "Cancel");
            }
        }
    }
    //More
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)