error 014: invalid statement; not in switch
#1

i have an issue on this dialog below


Код:
 error 014: invalid statement; not in switch
dont look how its made the [ code ] makes it spas out.

Код:
case DIALOG_CLICK: // this line coming up as the error
    {
       		if(!response) return SCM(playerid,-1,"Dialog is closed");
        	new
    	    text[128];
       		switch(listitem)
       		{
				case 0:
				{
					Kick(GetPVarInt(playerid,"pplayerid"));
					SetPVarInt(playerid,"pplayerid",999);
					format(text,sizeof(text),"Admin %s is kick you from server!",GetName(playerid));
					SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
				}
				case 1:
				{
					Ban(GetPVarInt(playerid,"pplayerid"));
					SetPVarInt(playerid,"pplayerid",999);
					format(text,sizeof(text),"Admin %s is ban you from server!",GetName(playerid));
					SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
				}
				case 2:
				{
					ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,"Admin Control Panel","Type admin level [1-5]","Make","Лxit");
				}
			}
   		}
Код:
C:\Users\Brandon\Desktop\gm\gamemodes\Untitled.pwn(1881) : error 014: invalid statement; not in switch
C:\Users\Brandon\Desktop\gm\gamemodes\Untitled.pwn(1881) : warning 215: expression has no effect
C:\Users\Brandon\Desktop\gm\gamemodes\Untitled.pwn(1881) : error 001: expected token: ";", but found ":"
C:\Users\Brandon\Desktop\gm\gamemodes\Untitled.pwn(1881) : error 029: invalid expression, assumed zero
C:\Users\Brandon\Desktop\gm\gamemodes\Untitled.pwn(1881) : fatal error 107: too many error messages on one line
Reply
#2

pawn Код:
if(dialogid == DIALOG_CLICK) // this line coming up as the error
    {
            if(!response) return SCM(playerid,-1,"Dialog is closed");
            new
            text[128];
            switch(listitem)
            {
                case 0:
                {
                    Kick(GetPVarInt(playerid,"pplayerid"));
                    SetPVarInt(playerid,"pplayerid",999);
                    format(text,sizeof(text),"Admin %s is kick you from server!",GetName(playerid));
                    SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
                }
                case 1:
                {
                    Ban(GetPVarInt(playerid,"pplayerid"));
                    SetPVarInt(playerid,"pplayerid",999);
                    format(text,sizeof(text),"Admin %s is ban you from server!",GetName(playerid));
                    SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
                }
                case 2:
                {
                    ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,"Admin Control Panel","Type admin level [1-5]","Make","Лxit");
                }
            }
        }
Why you put case?
Or put case DIALOG_CLICK in a switch.
Reply
#3

Quote:
Originally Posted by WopsS
Посмотреть сообщение
pawn Код:
if(dialogid == DIALOG_CLICK) // this line coming up as the error
    {
            if(!response) return SCM(playerid,-1,"Dialog is closed");
            new
            text[128];
            switch(listitem)
            {
                case 0:
                {
                    Kick(GetPVarInt(playerid,"pplayerid"));
                    SetPVarInt(playerid,"pplayerid",999);
                    format(text,sizeof(text),"Admin %s is kick you from server!",GetName(playerid));
                    SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
                }
                case 1:
                {
                    Ban(GetPVarInt(playerid,"pplayerid"));
                    SetPVarInt(playerid,"pplayerid",999);
                    format(text,sizeof(text),"Admin %s is ban you from server!",GetName(playerid));
                    SCM(GetPVarInt(playerid,"pplayerid"),-1,text);
                }
                case 2:
                {
                    ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,"Admin Control Panel","Type admin level [1-5]","Make","Лxit");
                }
            }
        }
Why you put case?
Or put case DIALOG_CLICK in a switch.
we all make mistakes thanks for your help
Reply
#4

Quote:
Originally Posted by Yves
Посмотреть сообщение
we all make mistakes thanks for your help
You're welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)