SA-MP Forums Archive
what is wrong with this Dialog - 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: what is wrong with this Dialog (/showthread.php?tid=210474)



what is wrong with this Dialog - yarrum3 - 13.01.2011

I get 26 error's so i think i am missing a bracket or something.


Код:
	if(dialogid == BUYLICENSE)
	{
		if(response == 1)
		{
		    switch(listitem)
		    {
		        case 0:
		        {
					{
      				if(PlayerInfo[playerid][plicencepoints] > 16)
					{
					    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* There's already a license registered in your name, you may not register another one!.");
					}
					else
					{
					    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Congratulations! You've registered a license in the State of San Andreas, watch out while driving!.");
					    PlayerInfo[giveplayerid][pCarLic] = 1;
					}
				}
				case 1:
				{
				    {
				        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
					}
				}
				case 2:
				{
				    {
				        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
					}
				}
				case 3:
				{
				    {
				        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
				    }
				}
			}
		}
	}
note to the people that don't understand what i mean by the 26 error thing when you take a bracket out of your script it will give you 26 errors on spots that are right and have nothing to do with that piece of code.


Re: what is wrong with this Dialog - Haydz - 13.01.2011

pawn Код:
if(dialogid == BUYLICENSE)
{
    if(response == 1)
    {
        switch(listitem)
        {
            case 0:
            {
                if(PlayerInfo[playerid][plicencepoints] > 16)
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* There's already a license registered in your name, you may not register another one!.");
                }
                else
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Congratulations! You've registered a license in the State of San Andreas, watch out while driving!.");
                    PlayerInfo[giveplayerid][pCarLic] = 1;
                }
            }
            case 1:
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
            }
            case 2:
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
            }
            case 3:
            {
                SendClientMessage(playerid, COLOR_LIGHTBLUE, "* None in stock!.");
            }
        }
    }
}
You also had some uneeded brackets like
pawn Код:
case 1:
{
      {
            SendClientMessage
      }
}
//instead of
case 1:
{
     SendClientmessage
}



Re: what is wrong with this Dialog - Tee - 13.01.2011

Lol someone beated me, so i deleted my post .