error 014: invalid statement; not in switch
#2

You're returning 1 straight after the first case, so the next case is inaccessible.

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case 1:
            {
                // your code here
                return 1;
            }
            // return 1; returning 1 here will prevent anything else after this case, unless you define a new switch, but returning 1 inside the case works
            // so you're not suppose to have it there, you're suppose to have it inside the case's so it will return the value at the end of the case completion
            case 2:
            {
                // your code here
                return 1;
            }
            case 3:
            {
                // your code here
                return 1;
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
error 014: invalid statement; not in switch - by DamonD - 14.10.2013, 21:03
Re: error 014: invalid statement; not in switch - by DanishHaq - 14.10.2013, 21:08
Re: error 014: invalid statement; not in switch - by DamonD - 14.10.2013, 21:10
Re: error 014: invalid statement; not in switch - by InglewoodRoleplay - 14.10.2013, 21:10
Re: error 014: invalid statement; not in switch - by DamonD - 14.10.2013, 21:31
Re: error 014: invalid statement; not in switch - by arakuta - 14.10.2013, 22:01
Re: error 014: invalid statement; not in switch - by DanishHaq - 14.10.2013, 22:01

Forum Jump:


Users browsing this thread: 1 Guest(s)