Pawno compiler crashes when a new dialog is created.
#8

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new pDialog[512];
    if(response) // They pressed the first button.
    {
        switch(dialogid) // If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
            case 999: // Our dialog!
            {
                switch(listitem)
                {// Checking which listitem was selected
                    case 0:// The first item listed
                    {
                        if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
                        {
                            ShowPlayerDialog(playerid, HELP6, DIALOG_STYLE_MSGBOX, "LSPD","/door (/r)adio (/d)epartments (/m)egaphone (/su)spect /lspd /mdc /detain /arrest /wanted /cuff /tazer /showbadge\n/leofrisk /take /ticket (/gov)ernment /deliver /clothes /invite /giverank /deployspikes /deletespike(s)",pDialog,"okay","Close");
                        }
                    }
                    case 1: // The second item listed
                    {
                        SendClientMessage(playerid, COLOR_GREEN, "FBI to go here.");
                    }
                }
            }
        }
    }
    return 1;
}
There - do you see how much better it is to look at indented code?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)