dialog
#1

Hi im making a dialog how can I make a [NEXT] so when a player presses it, it brings him to another page like this.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == russianbar)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {

                    if(GetPlayerMoney(playerid) < 25) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -25);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+15);
                    ApplyAnimation(playerid,"VENDING","VEND_Drink2_P",4.1,0,1,1,1,1,1);


                }
                case 1:
                {
                    if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -50);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+25);
                    ApplyAnimation(playerid,"VENDING","VEND_Drink2_P",4.1,0,1,1,1,1,1);

                }
                case 2:
                {
                    if(GetPlayerMoney(playerid) < 15) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -15);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+35);
                    ApplyAnimation(playerid,"VENDING","VEND_Drink2_P",4.1,0,1,1,1,1,1);


                }
                case 3:
                {
                    if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -75);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+40);
                    ApplyAnimation(playerid,"VENDING","VEND_Drink2_P",4.1,0,1,1,1,1,1);

                }
                case 4:
                {
                    if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFF0000FF, "You don't have enough cash.");
                    GivePlayerMoney(playerid, -100);
                    GetPlayerHealth(playerid,hp);
                    SetPlayerHealth(playerid,hp+50);
                    ApplyAnimation(playerid,"VENDING","VEND_Drink2_P",4.1,0,1,1,1,1,1);
                }
            }
        }
        return 1;
    }
Reply
#2

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case RACENAMEDIALOG:
        {
            //Do Stuff Here
            ShowPlayerDialog(playerid, TELEPORTDIALOG, DIALOG_STYLE_INPUT, "Teleport Command:", "Type The Name Of The Teleport (No Spaces):", "Next", "Cancel");
        }
        case TELEPORTDIALOG:
        {
            //do stuff here
            ShowPlayerDialog(playerid, PRIZEMONEYDIALOG, DIALOG_STYLE_LIST, "Prize Money", "$10,000\n$20,000\n$30,000\n$40,000\n$50,000\n$100,000\n$250,000\n$500,000", "Next", "Cancel");
        }
A part of my race filterscript. The way I did it is simply added ShowPlayerDialog within OnDialogResponse.
Reply
#3

Use a message box, and use the response functions in OnDialogResponse

ie:

Код:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Your dialog title", "Your dialog message", "Responded to dialog(aka Ok)", "Did not respond to dialog(aka Cancel(Or Next ;) ))");
So when they don't respond to the dialog, show the other dialog of your choice.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)