After switch(dialogid) I get errors.
#1

I'm working on dialogs for a script I'm doing. After switch(dialogid) I get 4 errors and a warning. Here's the code.
Код:
(line 995) public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(response)
	{
	    switch(dialogid)
	    {
			if(dialogid == electronics_shop_dialog)
 			{
  				if(listitem == 0) //Walkie Talkie
				{
  					if(PlayerInfo[playerid][pWalkie] == 0)
    		 		{
						PlayerInfo[playerid][pWalkie]++;
					}
					if(PlayerInfo[playerid][pWalkie] == 1)
					{
   						SendClientMessage(playerid, COLOR_GREY, "You already own a walkie talkie!");
					}
				}
				if(listitem == 1) //Scanner
				{
					if(PlayerInfo[playerid][pScanner] == 0)
					{
					PlayerInfo[playerid][pScanner]++;
					}
					if(PlayerInfo[playerid][pScanner] == 1)
					{
						SendClientMessage(playerid, COLOR_GREY, "You already own a scanner!");
					}
				}
    		}
			return 1;
		}
	}
	return 1;
}(line 1030)
I do have a define for the dialogid
Код:
#define electronics_shop_dialog
Here are errors/warning:
Код:
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001) : error 029: invalid expression, assumed zero
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1001 -- 1003) : warning 215: expression has no effect
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1003) : error 001: expected token: ";", but found "if"
C:\Documents and Settings\GLB\My Documents\Dropbox\Scripts\Gavin\gamemodes\script.pwn(1003) : fatal error 107: too many error messages on one line
Thank you very much in advance for any help/answers.
Reply


Messages In This Thread
After switch(dialogid) I get errors. - by glbracer - 11.08.2012, 15:33
Re: After switch(dialogid) I get errors. - by kbalor - 11.08.2012, 15:58
Re: After switch(dialogid) I get errors. - by Vince - 11.08.2012, 15:59
Re: After switch(dialogid) I get errors. - by glbracer - 11.08.2012, 16:00
Re: After switch(dialogid) I get errors. - by glbracer - 11.08.2012, 16:06

Forum Jump:


Users browsing this thread: 1 Guest(s)