Error with dialog.
#5

You're missing one bracket, to my belief. And you need to close up the statements at the end.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == BUY_WEAPON) // Buy Weapon at ammunation
    {
        if(response)
        {
            if(listitem == 0)
            {

                GivePlayerWeapon(playerid, 24, 100);
            }
            else if(listitem == 1)
            {

                GivePlayerWeapon(playerid, 23, 100);
            }
            else if(listitem == 2)
            {

                GivePlayerWeapon(playerid, 25, 100);
            }
            else if(listitem == 3)
            {

                GivePlayerWeapon(playerid, 29, 100);
            }
            else if(listitem == 4)
            {

                GivePlayerWeapon(playerid, 31, 100);
            }
            else if(listitem == 5)
            {

                SetPlayerArmour(playerid, 100);
            }
            else if(listitem == 6)
            {

            }
        }
    }
    return 1;
}
And I suggest switching over to case.

pawn Код:
if(dialogid == 5 && response)
    {
        switch(listitem)
        {
             case 0: // bla bla
             {
                 return 1;
             }
             case 1: // bla bla
             {
                 return 1;
             }
             case 2: // bla bla
             {
                 return 1;
            }
            case 3: // bla bla
            {
                return 1;
            }
            case 4: // bla bla
            {
                return 1;
            }
            case 5: // bla bla
            {
                return 1;
            }
        } // end switch
    } // end if dialogid == 5
Reply


Messages In This Thread
Error with dialog. - by iLcke - 05.10.2010, 03:13
Re: Error with dialog. - by Caine Toth - 05.10.2010, 03:40
Re: Error with dialog. - by iLcke - 05.10.2010, 03:45
Re: Error with dialog. - by iLcke - 05.10.2010, 03:49
Re: Error with dialog. - by iFriSki - 05.10.2010, 03:52
Re: Error with dialog. - by iLcke - 06.10.2010, 03:12

Forum Jump:


Users browsing this thread: 1 Guest(s)