SA-MP Forums Archive
Solve this serious error with 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)
+--- Thread: Solve this serious error with dialogs! (/showthread.php?tid=573304)



Solve this serious error with dialogs! - losrivarola98 - 06.05.2015

Happens that the dialogues that are sent after another dialogue is answered, returned ID 0 and being answered nothing happens. For example:
pawn Код:
CMD:asd(playerid,params[])
{
    ShowPlayerDialog(playerid,2,DIALOG_STYLE_MSGBOX,"Shop","Do you want to buy vehicles?","Yes","No");//First dialog sent
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 2://Thats responds correctly
        {
            if(response) ShowPlayerDialog(playerid,3,DIALOG_STYLE_TABLIST_HEADER,"Title","Name of vehicles\tPrice\nCheetah\t50000$\nSultan\t60000","Buy","Cancel");
            return 1;//Shows the dialog correctly
        }
        case 3://But this dialog isnt responds
        {
            switch(listitem)
            {
                case 0:
                {
                    //Do anything..
                }
                case 1:
                {
                    //The same
                }
            }
            return 1;
        }
    }
    return 0;
}
I test it with the plugin YSF and the native function GetPlayerDialog, and I saw that returns 0, why?
Solve this!!


Re: Solve this serious error with dialogs! - Konstantinos - 06.05.2015

Use some other dialog ID as it may conflict with another script(s) that use that dialog ID.


Respuesta: Re: Solve this serious error with dialogs! - losrivarola98 - 06.05.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Use some other dialog ID as it may conflict with another script(s) that use that dialog ID.
Isn't used that ID in another script.. This error is a great bug of SAMP 0.3.7 on Linux version...


Re: Solve this serious error with dialogs! - Hanger - 06.05.2015

YOU DID NOT CLOSE YOUR "CASE 2:", AMEN
Код:
case 2://Thats responds correctly
	    {
	        if(response) ShowPlayerDialog(playerid,3,DIALOG_STYLE_TABLIST_HEADER,"Title","Name of vehicles\tPrice\nCheetah\t50000$\nSultan\t60000","Buy","Cancel");
			return 1;//Shows the dialog correctly
		}
		case 3://But this dialog isnt responds
	    {



Respuesta: Re: Solve this serious error with dialogs! - losrivarola98 - 06.05.2015

Quote:
Originally Posted by Hanger
Посмотреть сообщение
YOU DID NOT CLOSE YOUR "CASE 2:", AMEN
Код:
case 2://Thats responds correctly
	    {
	        if(response) ShowPlayerDialog(playerid,3,DIALOG_STYLE_TABLIST_HEADER,"Title","Name of vehicles\tPrice\nCheetah\t50000$\nSultan\t60000","Buy","Cancel");
			return 1;//Shows the dialog correctly
		}
		case 3://But this dialog isnt responds
	    {
Men, thats was a example, not my script...


Re: Solve this serious error with dialogs! - Hanger - 06.05.2015

Then tell me why dialogs are functioning correctly for, I'd say, 99.9% of us? Stop posting crap and do your homework before you cry.


Respuesta: Solve this serious error with dialogs! - losrivarola98 - 06.05.2015

I just solved my problem, making a timer of 100 milliseconds to show the next dialog. Thank WHICH HELPED ME