(22169) : error 002: only a single statement (or expression) can follow each "case"
#1

(22169) : error 002: only a single statement (or expression) can follow each "case"



Line 22169:

Code:
		case 29: // ARMY Armory
		{
		    ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "Army Lockers", "Nightstick ($50)\nMace ($100)\nDesert Eagle ($200)\nShotgun ($100)\nMP5 ($600)\nM4 ($1000)\nCombat Shotgun ($1500)\nSniper Rifle ($2500)\nPainkiller ($100)\nVest ($200)", "Choose", "Cancel");
        }
	return 1;
}
Reply
#2

You'll have to end the switch statement before setting return 1, like this
Code:
case 29: // ARMY Armory
		{
		    ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "Army Lockers", "Nightstick ($50)\nMace ($100)\nDesert Eagle ($200)\nShotgun ($100)\nMP5 ($600)\nM4 ($1000)\nCombat Shotgun ($1500)\nSniper Rifle ($2500)\nPainkiller ($100)\nVest ($200)", "Choose", "Cancel");
               }
       }
	return 1;
}
Hope it helped
Reply
#3

Looks like you are missing a bracket there? '}'

EDIT: Ranama was few seconds faster than me.
Reply
#4

Code:
Lets make it easier

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_MAIN)
    {
        if(!response) return SendClientMessage(playerid, -1, "Lucky to have this code in my pc already");

        switch(listitem)
        {
            case 27:
            {
                ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "Army Lockers", "Nightstick ($50)\nMace ($100)\nDesert Eagle ($200)\nShotgun ($100)\nMP5 ($600)\nM4 ($1000)\nCombat Shotgun ($1500)\nSniper Rifle ($2500)\nPainkiller ($100)\nVest ($200)", "Choose", "Cancel");
            }
       
            }
        } //this was missing
        if(dialogid == DIALOG_SHOP)
        {
        
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerPos(playerid, add-whatever you wish);
                }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)