Message dialog box help.
#1

Hey guys, first of all Merry Christmas.

I need urgent help, i want to know how to make dialog box in dialog box.

Thank in advance.
Reply
#2

pawn Код:
ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MSGBOX,"Title here","This is a testing dialog box.","ok","");
Source : https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/Dialog_Styles
Reply
#3

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
pawn Код:
//CMD:msgbox(playerid, params[])
{
    ShowPlayerDialog(playerid,dialogid,DIALOG_STYLE_MSGBOX,"Title here","This is a testing dialog box.","ok","");
    //return 1;
//}
Source : https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/Dialog_Styles
@Silent, Thanks for your help bro. But im not talking but this, i mean when i click "ok" it should open other msg dialog box.
Reply
#4

go to your Dialog id in OnDialogResponse and do

Quote:
Originally Posted by Player23
Посмотреть сообщение
@Cutx, bro can you please give me an small example.
in this example i'll use 3334 as dialogid
PHP код:
//top:
#define SOME_DIALOG 3334
//---
//somewhere, idk where you have it:
ShowPlayerDialog(playerid,SOME_DIALOG,DIALOG_STYLE_MSGBOX,"Title here","This is a testing dialog box.","ok","");
//------
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        
//some dialogs....
        //....
        
case SOME_DIALOG:
        {
            if(
responseShowplayerdialog.... //and so on thats the next dialog when you click "ok"
            
else //do something else if they dont click ok
        
}
        
//.....
        //.........
    
}
    return 
1;

that's it. When you click ok, the next dialog (after"if(response)") appears.
Now if you want another one after that, just repeat this.
Reply
#5

Код:
CMD:test(playerid, params[])
{
          /test
		ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}Test Commands", str, "Ok", "Cancel");
	}
	return 1;
}
Reply
#6

Quote:
Originally Posted by CutX
Посмотреть сообщение
go to your Dialog id in OnDialogResponse and do

PHP код:
if(responseShowplayerdialog.... and so on
else //do something else if they dont click ok 
@Cutx, bro can you please give me an small example.
Reply
#7

Ahh , sorry for wrong understanding .

Ok so you'll need to create the first dialog , like the one i gaved above and let's say that the dialog id == 12
pawn Код:
ShowPlayerDialog(playerid,12,DIALOG_STYLE_MSGBOX,"Title here","This is a testing dialog box.","ok","");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
    {
        if(response)//if he pressed ok on dialog 12.
        {
        ShowPlayerDialog(playerid,13,.....);//another dialog bump up for him.
        }
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Ahh , sorry for wrong understanding .

Ok so you'll need to create the first dialog , like the one i gaved above and let's say that the dialog id == 12
pawn Код:
ShowPlayerDialog(playerid,12,DIALOG_STYLE_MSGBOX,"Title here","This is a testing dialog box.","ok","");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
    {
        if(response)//if he pressed ok on dialog 12.
        {
        ShowPlayerDialog(playerid,13,.....);//another dialog bump up for him.
        }
    }
    return 1;
}
@Silent, Bro if i want another after "13" then
Reply
#9

Example if you want a /help command with the Dialogbox

Код:
CMD:help(playerid, params[])
{
	new str[3000];
        /newbie /tognewbie /requesthelp /families /refuel /car 
	{
		ShowPlayerDialog(playerid, DIALOG_SHOW_INFO, DIALOG_STYLE_MSGBOX, "{33AA33}Help Commands", str, "Ok", "Cancel");
	}
	return 1;
}
Reply
#10

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 12)
    {
        if(response)//if he pressed ok on dialog 12.
        {
        ShowPlayerDialog(playerid,13,.....);//another dialog bump up for him.
        }
    }
    //another dialog checking.
    if(dialogid == 13) //if the dialog id equal too 13
    {
        if(response)//if he pressed ok on dialog id 13.
        {
        ShowPlayerDialog(playerid,14,.....);//another dialog bump up for him.
        }
    }
    return 1;
}
Just check dialog id OnDialogResponse for each dialog you created and check for response or not. if(response) if he clicked ok do something , if(!response) he he pressed the second button you can do another thing.

PS:This forum requires that you wait 240 seconds between posts. Please try again in 66 seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)