SA-MP Forums Archive
Small Dialog item Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Small Dialog item Problem (/showthread.php?tid=153617)



Small Dialog item Problem - Kayla.S - 09.06.2010

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;
}



Re: Small Dialog item Problem - Micko9 - 09.06.2010

what exactly doesn't work about it?


Re: Small Dialog item Problem - Joe_ - 09.06.2010

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.


Re: Small Dialog item Problem - Kayla.S - 09.06.2010

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


Re: Small Dialog item Problem - Micko9 - 09.06.2010

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