SA-MP Forums Archive
Dialog help - 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: Dialog help (/showthread.php?tid=282133)



Dialog help - spd_sahil - 09.09.2011

guys im making these sets of dialogs which are used to start a deathmatch kind of minigame..

i want help in knowing that how can i put them in series one after another.. as in.. when im finished selecting options in 1 the other comes.. and then the third..

also.. when im done with selecting what all i want from dialogs.. i want all of them to execute together.. not one by one.. but all of them together

SUMMARY :

-DIalog 1

-Dialog 2

-Dialog 3

- ALL DIALOGS output together


Re: Dialog help - Jafet_Macario - 09.09.2011

pawn Код:
ShowPlayerDialog(playerid, 1, ...); // create the first dialog at your start minigame command


// OnDialogResponse:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        // what first dialog should do
        ShowPlayerDialog(playerid, 2, ...); // shows dialog 2
    }
    if(dialogid == 2)
    {
        // what second dialog should do
        ShowPlayerDialog(playerid, 3, ...); // show dialog 3
    }
    if(dialogid == 3)
    {
        // what dialog id 3 should do and so on
    }
    return 1;
}
This will help you: https://sampwiki.blast.hk/wiki/ShowPlayerDialog
And this also: https://sampwiki.blast.hk/wiki/OnDialogResponse


Re: Dialog help - spd_sahil - 09.09.2011

alright.. i got how to put them in series..thanks

but now.. when i select option in the dialog wont it execute right then ?? i want all of them to exectue together


Re: Dialog help - Jafet_Macario - 09.09.2011

Here is an example:
pawn Код:
new Money[MAX_PLAYERS], Skin[MAX_PLAYERS]; // example

ShowPlayerDialog(playerid, 1, ...); // your command

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {  
        if(response)
        {
            Money[playerid] = 500; // example
            ShowPlayerDialog(playerid, 2, ...); // shows dialog 2
        }
        else
        {
            //
        }
    }
    if(dialogid == 2)
    {
        if(response)
        {
            Skin[playerid] = 23;// example
            ShowPlayerDialog(playerid, 3, ...); // show dialog 3
        }
        else
        {
             //
        }
    }
    if(dialogid == 3)
    {
        if(response)
        {
            GivePlayerMoney(playerid, Money[playerid]); // example
            SetPlayerSkin(playerid, Skin[playerid]); // example
        }
        else
        {
             //
        }
    }
    return 1;
}



Re: Dialog help - spd_sahil - 09.09.2011

i figured out the logic thanks neways