help with these errors
#1

GXG.pwn(1604 : error 002: only a single statement (or expression) can follow each "case"
GXG.pwn(16048 -- 16049) : error 028: invalid subscript (not an array or too many subscripts): "dialogid"
GXG.pwn(16048 -- 16050) : error 001: expected token: "}", but found "case"
GXG.pwn(16048 -- 16050) : fatal error 107: too many error messages on one line

Код:
	switch( dialogid )
	{
		case DIALOG_BANK:
		{
			if(!response) return 0;
			if(response)
			{
				if(listitem == 0)
				{
					new str[128];
		            format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Deposit Below :",PlayerInfo[playerid][pAccount]);
	              	ShowPlayerDialog(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit",str, "Deposit", "Back");
				}
				if(listitem == 1)
				{
					new str[128];
		            format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Withdraw Below :",PlayerInfo[playerid][pAccount]);
	              	ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw",str, "Withdraw", "Back");
				}
				if(listitem == 2)
				{
					new str[128];
		            format(str,sizeof(str),"Your Current Balance Is : $%d\nEnter The Player ID You Want To Transfer To Below :",PlayerInfo[playerid][pAccount]);
		            ShowPlayerDialog(playerid,DIALOG_TRANSFER1,DIALOG_STYLE_INPUT,"Transfer",str,"Next","Back");
				}
				if(listitem == 3)
				{
					new str[128];
					format(str, sizeof(str), "Your current bank balance is: $%d", PlayerInfo[playerid][pAccount]);
					ShowPlayerDialog(playerid, DIALOG_BALANCE, DIALOG_STYLE_MSGBOX, "Bank account", str, "Back", "");
				}
			}
		}
		case DIALOG_DEPOSIT:
		{
			if(!response) return ShowPlayerDialogEx(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
			else if(strval(inputtext) > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount!");
			else if(!IsNumeric(inputtext))
			{
				new str[128];
				format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Deposit Below :",PlayerInfo[playerid][pAccount]);
	           	ShowPlayerDialog(playerid, DIALOG_DEPOSIT, DIALOG_STYLE_INPUT, "Deposit",str, "Deposit", "Back");
				SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
			}
			else
			{
				new str[128];
				new inputext = strval(inputtext);
				PlayerInfo[playerid][pAccount] += inputext;
				GivePlayerCash( playerid, - strval( inputtext) );// removing the money from 'pocket'
				format(str, sizeof(str), "You have deposited $%d into your account. New balance: $%d", inputext, PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, 0x008000FF, str);
			}
		}
		case DIALOG_WITHDRAW:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
			else if(strval(inputtext) > PlayerInfo[playerid][pAccount]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount in your bank");
			else if(!IsNumeric(inputtext))
			{
				new str[128];
				format(str,sizeof(str),"Your Curret Balance Is : $%d\nEnter The Amount You Want To Withdraw Below :",PlayerInfo[playerid][pAccount]);
	           	ShowPlayerDialog(playerid, DIALOG_WITHDRAW, DIALOG_STYLE_INPUT, "Withdraw",str, "Withdraw", "Back");
				SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
			}
			else
			{
				new str[128];
				new inputext = strval(inputtext);
				PlayerInfo[playerid][pAccount] -= inputext;
				GivePlayerCash( playerid, strval( inputtext ) );// this will add the money from the bank account to your own money
				format(str, sizeof(str), "You have withdrawn $%d out of your account. New balance: $%d", inputext, PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, 0x008000FF, str);
			}
		}
		case DIALOG_TRANSFER1:
		{
			if(!response) return ShowPlayerDialogEx(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
			else if(strval(inputtext) == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player Not Online");
			else if(!IsNumeric(inputtext))
			{
				new str[128];
				format(str,sizeof(str),"Your Current Balance Is : $%d\nEnter The Player ID You Want To Transfer To Below :", PlayerInfo[playerid][pAccount]);
				ShowPlayerDialog(playerid,1130,DIALOG_STYLE_INPUT,"Transfer",str,"Next","Back");
				SendClientMessage(playerid,COLOR_RED,"Please Use ID Not Name");
			}
			else
			{
				chosenpid = strval(inputtext);
				new str[128];
				format(str,sizeof(str),"Balance : %d\nChosen Player ID : %d\nNow Enter The Amount You Want To Transfer",PlayerInfo[playerid][pAccount],chosenpid);
				ShowPlayerDialog(playerid,DIALOG_TRANSFER2,DIALOG_STYLE_INPUT,"Transfer",str,"Transfer","Back");
			}
		}
		case DIALOG_TRANSFER2:
		{
			if(!response) return ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");
			else if(strval(inputtext) > PlayerInfo[playerid][pAccount]) return SendClientMessage(playerid,COLOR_RED,"You Don't Have That Amount In Bank To Transfer");
			else if(!IsNumeric(inputtext))
			{
				new str[128];
				format(str,sizeof(str),"Chosen Player ID : %d\nNow Enter The Amount You Want To Transfer",chosenpid);
				ShowPlayerDialog(playerid,1131,DIALOG_STYLE_INPUT,"Transfer",str,"Transfer","Back");
				SendClientMessage(playerid,COLOR_RED,"Please Use Numbers");
			}
			else
			{
				PlayerInfo[playerid][pAccount] -= strval(inputtext);
				PlayerInfo[chosenpid][pAccount] += strval(inputtext);
				new str[128];
				format(str,sizeof(str),"You Transfered $%d To ID %d's Bank Account",strval(inputtext),chosenpid);
				SendClientMessage(playerid, 0x008000FF, str);
				new str2[128];
				format(str2,128,"Your New Balance Is : $%d",PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid,0x008000FF,str2);
				new str3[128];
				format(str3,128,"ID : %d Transfered $%d To Your Bank Account",playerid,strval(inputtext));
				SendClientMessage(chosenpid,0x008000FF,str3);
				new str4[128];
				format(str4, 128, "Your New Balance : $%d", PlayerInfo[chosenpid][pAccount]);
				SendClientMessage(chosenpid, 0x008000FF, str4);
				ShowPlayerDialog(playerid,1125,DIALOG_STYLE_LIST,"Bank","Deposit\nWithdraw\nBalance\nTransfer","Select","Cancel");
			}
		}
		case DIALOG_BALANCE:
		{
			if(response)
			{
				ShowPlayerDialog(playerid, DIALOG_BANK, DIALOG_STYLE_LIST, "{007A00}Bank account", " Deposit \n Withdraw \n Balance", "Select", "Cancel");

			}
		}
Reply


Forum Jump:


Users browsing this thread: