OnDialogResponse problem -
Yvax - 06.11.2011
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?
Re: OnDialogResponse problem -
Wesley221 - 06.11.2011
If youre using it in a filterscript, the callback should return 0.
pawn Код:
public OnDialogResposne(....)
{
return 0;
}
Re: OnDialogResponse problem -
Yvax - 06.11.2011
I'm not using it in a filterscript
Re: OnDialogResponse problem -
Wesley221 - 06.11.2011
Then show the part where its going wrong
Re: OnDialogResponse problem -
Yvax - 06.11.2011
Everything is wrong.I used a print after if(dialogid == 1) and it doesn't even show up.
Re: OnDialogResponse problem -
Wesley221 - 06.11.2011
Quote:
Originally Posted by Wesley221
Then show the part where its going wrong
|
---^
Re: OnDialogResponse problem -
Yvax - 06.11.2011
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)
Re: OnDialogResponse problem -
Yvax - 06.11.2011
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?
Re: OnDialogResponse problem -
Yvax - 07.11.2011
Anyone knows how to solve this, please?
Re: OnDialogResponse problem -
Kostas' - 07.11.2011
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;
}