Small Dialog item Problem
#1

Ok this I know is an easy fix, but I can't figure out what it is.. I have a bar menu that has 3 items in it. The first 2 work great. For some reason when I select the 3rd one, nothing happens..

Here is when they enter the checkpoint

pawn Код:
ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Bar","Beer\nWine\nRed Bull", "Accept", "Cancel");
After they select their item.

pawn Код:
if(dialogid == 8)
    {
        if(response)
        {
           
            if(listitem == 0)//Beer
            {
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
  }
            if(listitem == 1)//Wine
            {
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);

            if(listitem == 2)//Red Bull
            {
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
            SetPlayerDrunkLevel (playerid, 0);

            }
                     return 1;
            }
        }
    }
    return 1;
}
Reply
#2

what exactly doesn't work about it?
Reply
#3

pawn Код:
if(dialogid == 8)
{
    if(response)
    {
        if(listitem == 0)//Beer
        {
          SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
        }
        if(listitem == 1)//Wine
        {
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
        }
        if(listitem == 2)//Red Bull
        {
            SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_SPRUNK);
        SetPlayerDrunkLevel (playerid, 0);
        }
        return 1;
    }
    return 1;
}
You missed a braket, check your code before you post, this is a epicly simple mistake.
Reply
#4

wow... can't believe I missed that.. >.< I'll give it a try. Thanks
Reply
#5

You missed a bracket right here :

Код:
			if(listitem == 1)//Wine
			{
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
just add '}'

Код:
			if(listitem == 1)//Wine
			{
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE);
			}
oh sorry for double post didn't see that he already replied lol


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)