SA-MP Forums Archive
dialogs - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dialogs (/showthread.php?tid=249556)



dialogs - fissekarl - 19.04.2011

hello

when i press "Confirm" the msgbox doesnt go away it keep staying there

pawn Код:
if(dialogid == 2)
    {
        ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
        return 0;
    }
    return 1;
}



Re: dialogs - blackwave - 19.04.2011

pawn Код:
if(response && dialogid == 2) // If press left button of dialog and dialogid be 2
{
      ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
      return 0;
}
Also on the end of callback OnDialogResponse, put return 0; instead return 1; , for avoid bugs.


Re: dialogs - fissekarl - 19.04.2011

I still cant remove it :S


Re: dialogs - Cjgogo - 19.04.2011

if(response == 1)
{
SendClientMessage(playerid,ur color,"Add this above your dialog,and I hope it works");
}


Re: dialogs - Vince - 19.04.2011

You're stuck in a infinite loop right there. When you click on a button, OnDialogResponse gets called, and it will show that same message again and again, because you use the same dialogid.


Re: dialogs - fissekarl - 19.04.2011

Then how to fix it vince?


Re: dialogs - Vince - 19.04.2011

Use another dialogid. Or set a variable and then check it. Use your imagination.


Re: dialogs - Niko_boy - 19.04.2011

Quote:

if(dialogid == 2)
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"T est","Test","Confirm","");
return 0;
}
return 1;
}

see you are using dialog response of dialog id 2,
but you have returned out same dialog id

in this line
pawn Код:
ShowPlayerDialog(playerid,[b]2[/b],DIALOG_STYLE_MSGBOX,"Test","Test","Confirm","");
your are retuning back dialog id 2 , instead you are supposed to use another dialog which is your next one .


Re: dialogs - fissekarl - 19.04.2011

Quote:
Originally Posted by Jagat
Посмотреть сообщение
your are retuning back dialog id 2 , instead you are supposed to use another dialog which is your next one .
But I dont need a next dialog.

All I need is when players see that MSG box, they press Confirm (only 1 buttom) and then the msg box will be gone (ofc it will pop up again when they type a cmd)


Re: dialogs - Gertin - 19.04.2011

Quote:
Originally Posted by fissekarl
Посмотреть сообщение
But I dont need a next dialog.

All I need is when players see that MSG box, they press Confirm (only 1 buttom) and then the msg box will be gone (ofc it will pop up again when they type a cmd)
but post your cmd here plz . You use zcmd ?