OnDialogResponse help?
#1

Код:
C:\Users\Hellman.Hellmans-PC\Desktop\snusk\gamemodes\LC-RP.pwn(42560) : error 033: array must be indexed (variable "-unknown-")
pawn Код:
#define JEFFERSON1_DIALOG "BMX (10000) (Vehicle ID: 481) (( Time: 7 ))\nBike (10000) (Vehicle ID: 509) (( Time: 7 ))\nMountain Bike (10000) (Vehicle ID: 510) (( Time: 7 ))\nMower (15000) (Vehicle ID: 572) (( Time: 7 ))\nKart (20000) (Vehicle ID: 571) (( Time: 7 ))\nFaggio (20000) (Vehicle ID: 462) (( Time: 7 ))\nNext"
line 42560 if(dialogid == JEFFERSON1_DIALOG) //
    {
            switch(response)
            {
                case 0: // Using cancel
                {
                    SendClientMessage(playerid,COLOR_WHITE,"INFO: Closed menu.");
                }
                case 1: // Selecting
                {
                    switch(listitem)
                    {
                        case 0:
                        {
                            BuyVehicle(playerid,"BMX",481,10000,7);
                        }
                        case 1:
                        {
                            BuyVehicle(playerid,"Bike",509,10000,7);
                        }
                        case 2:
                        {
                            BuyVehicle(playerid,"Mountain Bike",510,10000,7);
                        }
                        case 3:
                        {
                            BuyVehicle(playerid,"Mower",572,15000,7);
                        }
                        case 4:
                        {
                            BuyVehicle(playerid,"Kart",571,20000,7);
                        }
                        case 5:
                        {
                            BuyVehicle(playerid,"Faggio",462,20000,7);
                        }
                        case 6:
                        {
                            ShowPlayerDialog(playerid,14,DIALOG_STYLE_LIST,"Jefferson Dealership",JEFFERSON2_DIALOG,"Purchase", "Exit");
                        }
                    }
                }
            }
        }
Reply
#2

Your first dialog, yes? Heh.

The line you've used in your define,
pawn Код:
"BMX (10000) (Vehicle ID: 481) (( Time: 7 ))\nBike (10000) (Vehicle ID: 509) (( Time: 7 ))\nMountain Bike (10000) (Vehicle ID: 510) (( Time: 7 ))\nMower (15000) (Vehicle ID: 572) (( Time: 7 ))\nKart (20000) (Vehicle ID: 571) (( Time: 7 ))\nFaggio (20000) (Vehicle ID: 462) (( Time: 7 ))\nNext"
is to be used in the ShowPlayerDialog function.

Example,
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"BMX (10000) (Vehicle ID: 481) (( Time: 7 ))\nBike (10000) (Vehicle ID: 509) (( Time: 7 ))\nMountain Bike (10000) (Vehicle ID: 510) (( Time: 7 ))\nMower (15000) (Vehicle ID: 572) (( Time: 7 ))\nKart (20000) (Vehicle ID: 571) (( Time: 7 ))\nFaggio (20000) (Vehicle ID: 462) (( Time: 7 ))\nNext","Select","Cancel");
You use that code to display your dialog, given that you've removed your current define. This would require that you change
pawn Код:
if(dialogid == JEFFERSON1_DIALOG)
to this:
pawn Код:
if(dialogid == 1)
Alternatively, you change
pawn Код:
#define JEFFERSON1_DIALOG "BMX (10000) (Vehicle ID: 481) (( Time: 7 ))\nBike (10000) (Vehicle ID: 509) (( Time: 7 ))\nMountain Bike (10000) (Vehicle ID: 510) (( Time: 7 ))\nMower (15000) (Vehicle ID: 572) (( Time: 7 ))\nKart (20000) (Vehicle ID: 571) (( Time: 7 ))\nFaggio (20000) (Vehicle ID: 462) (( Time: 7 ))\nNext"
to
pawn Код:
#define JEFFERSON1_DIALOG 1
and use this line to show your dialog (in a command, icon pickup, etc):
pawn Код:
ShowPlayerDialog(playerid,JEFFERSON1_DIALOG,DIALOG_STYLE_LIST,"BMX (10000) (Vehicle ID: 481) (( Time: 7 ))\nBike (10000) (Vehicle ID: 509) (( Time: 7 ))\nMountain Bike (10000) (Vehicle ID: 510) (( Time: 7 ))\nMower (15000) (Vehicle ID: 572) (( Time: 7 ))\nKart (20000) (Vehicle ID: 571) (( Time: 7 ))\nFaggio (20000) (Vehicle ID: 462) (( Time: 7 ))\nNext","Select","Cancel");
Edit: Reviewed this a bit and you could also use your current define this way:
pawn Код:
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,JEFFERSON1_DIALOG,"Select","Cancel");
and change
pawn Код:
if(dialogid == JEFFERSON1_DIALOG)
to this:
pawn Код:
if(dialogid == 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)