[Help] Dialogue
#1

Hello,
I am working on dialogs and I was scripting on dialogs but it is not working that how I except from it. I actually want to combine one dialogue into another one. For example:

My first dialog have 3 items and these items have their own specific items in another dialogue.


How do I code it?

Thanks for helping me!

Sincerely,
William McKnight
Reply
#2

I will give you a fast example for it: let's say i have two dialogs
pawn Код:
//In some command:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Dialog one","Test 1\nTest 2","Select","Cancel");
//In other command or something:
ShowPlayerDialog(playerid,2,DIALOG_STYLE_LIST,"Dialog one","Test 3\nTest 4","Select","Cancel");
//OnDialogResponse callback:
if(dialogid == 1)
{
    switch(listitem)
    {
        case 0: return SendClientMessage(playerid,-1,"test 1");
        case 1: return SendClientMessage(playerid,-1,"test 2");
    }
}
if(dialogid == 2)
{
    switch(listitem)
    {
        case 0: return SendClientMessage(playerid,-1,"test 3");
        case 1: return SendClientMessage(playerid,-1,"test 4");
    }
}
//To combine them all together you should simply find out ondialogresponse if(dialogid == the id you use example i used in the first dialog id 1, dialog two id 2
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Dialog one","Test 1\nTest 2\Test 3\nTest 4","Select","Cancel");
if(dialogid == 1)
{
    switch(listitem)
    {
        case 0: return SendClientMessage(playerid,-1,"test 1");
        case 1: return SendClientMessage(playerid,-1,"test 2");
        case 2: return SendClientMessage(playerid,-1,"test 3");
        case 3: return SendClientMessage(playerid,-1,"test 4");
    }
}
Reply
#3

Thanks for helping. But, you don't think that you got me. I am saying that How could I go to another dialogue from one? and use the same other dialogue for another item.

For Example:

Dialogue 1:
Item[0] = PoliceSiren1 <<< If I click on this item then It will send me to Dialogue 2.
Item[1] = PoliceSiren2 <<<< If I click on this item then It will send me to Dialogue 2.

Dialogue 2:
Item[0] = Roof
Item[1] = DashBox
Item[2] = Remove

I hope that you'll understand me now.

Issue solved!
Special thanks to the above guy for helping me out and you know that how did he help me? He gave me an idea to do this process by using switch case. Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)