Dialog problem
#1

Nvm.
Reply
#2

These are ALL self explanatory. Although I doubt it would take much time to look through these and fix them, I will only do so when you edit your post showing what lines the errors are on.

First off, define your dialog.

pawn Код:
#define DIALOG_TOYS placeadialogidherethatisnotalreadyinuse
Then, also define white.

pawn Код:
#define WHITE colorhere
Reply
#3

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Snip.
I've narrowed it down to 2 errors now.

I just put the dialog id into the defines - still not working.



The next is a simple mistake, but I'm still having it.


Reply
#4

pawn Код:
command(attach, playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_TOYS, DIALOG_STYLE_LIST, "Attach toys", "Briefcase\nFire Hydrant\nGas Pump\nWooden Crate\nSmall Buolder\nBBQ Grill\nBeer\nTelevision", "Select", "Cancel");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case 1:
        {
            if(!response)
            {
                SendClientMessage(playerid, WHITE, "You cancelled.");
                return 1;
            }

            switch(listitem)
            {
                case 0:
                {
                    AttachObjectToPlayer(1210, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 1:
                {
                    AttachObjectToPlayer(1211, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 2:
                {
                    AttachObjectToPlayer(1244, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 3:
                {
                    AttachObjectToPlayer(1271, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 4:
                {
                    AttachObjectToPlayer(1304, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 5:
                {
                    AttachObjectToPlayer(1481, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 6:
                {
                    AttachObjectToPlayer(1484, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }
                case 7:
                {
                    AttachObjectToPlayer(1518, playerid, 1.5, 0.5, 0.0, 0.0, 1.5, 2);
                }

            }

        }
    }
    return 0;
}
Try this.

And the return 1; error makes no sense, is there a random other end bracket that would prevent the thing from continuing, or something?

EDIT: If the DIALOG_TOYS define thing doesn't work, are you sure that there is no other dialog id with the id of 1?
Reply
#5

K. The OnDialogResponse is okay now. Guess it was the command.

pawn Код:
command(attach, playerid, params[])
{
    ShowPlayerDialog(playerid, DIALOG_TOYS, DIALOG_STYLE_LIST, "Attach toys", "Briefcase\nFire Hydrant\nGas Pump\nWooden Crate\nSmall Buolder\nBBQ Grill\nBeer\nTelevision", "Select", "Cancel");
  }
    return 1;
}
and my define for the 'Toys':

pawn Код:
#define DIALOG_TOYS     1

Still having problems with the return.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)