Posts: 261
Threads: 32
Joined: Dec 2018
What the hell is wrong? I'm getting "duplicate "case" label (value 11) at this code placed on OnDialogResponse:
pawn Code:
/* ---- Commands Dialog ---- */
case DIALOG_COMMANDS:
{
if(!response) return 1;
switch(listitem)
{
case 0: ShowGeneralCmds(playerid);
case 1: ShowPMCmds(playerid);
case 2: ShowGarageCmds(playerid);
case 3: ShowCrateCmds(playerid);
case 4: ShowCollectiblesCmds(playerid);
case 5: ShowBountyCmds(playerid);
case 6: ShowReputationCmds(playerid);
case 7: ShowCookiesCmds(playerid);
case 8: ShowPartyCmds(playerid);
case 9: ShowDeathmatchCmds(playerid);
case 10: ShowTeleportCmds(playerid);
}
}
/* ------------------------- */
Posts: 15,941
Threads: 0
Joined: Jun 2008
Posts: 3
Threads: 0
Joined: Feb 2019
Reputation:
0
Check your dialog's id. Probably you have some contrast.
Try to insert these in enum.
Posts: 262
Threads: 33
Joined: Mar 2018
Reputation:
0
find somethere "case 11:" in your code and delete case, which is duplicated.
Posts: 497
Threads: 21
Joined: Feb 2018
Reputation:
0
Duplicate "case label (value 11)" means you duplicated case dialog 11 in your switch. You may have some defines with same id of your dialog too, check out.
Posts: 15,941
Threads: 0
Joined: Jun 2008
So I said it isn’t that one, referring to the inner switch in the code you posted. I forgot about the outer one - what is the value of DIALOG_COMMANDS? I guess 11, and I also guess another dialog is also 11. I suggest using far more unique IDs, like 56940983 instead of common numbers like 0-99.
Posts: 261
Threads: 32
Joined: Dec 2018
I don't even use ID's for dialogs. I place them in an enum.
pawn Code:
enum
{
DIALOG_TEST,
DIALOG_CMDS,
//And so on..
}
And the problem is only with this dialog because with other dialogs there are no problems.
However i searched for case 11: and found nothing on OnDialogResponse.
Posts: 1,801
Threads: 21
Joined: Mar 2008
Reputation:
0
You might have placed the same dialog id twice.
Which exact line is the error line? Search for that one to find it.
Posts: 261
Threads: 32
Joined: Dec 2018
It's impossible to place same dialog ID because they're stored in an enum. The error line is referred to case DIALOG_COMMANDS: and i seriously can't see where Pawno has took out this "case 11" from. This is stupid.
Posts: 261
Threads: 32
Joined: Dec 2018
Ok assigned ID 1300 at first dialog, now:
pawn Code:
error 040: duplicate "case" label (value 1311)
Now i got it, 1311 is the dialog ID assigned to DIALOG_COMMANDS.
I tried #define DIALOG_COMMANDS 5000 (a more higher value) and it worked.
This Pawno is so damn strange.
Posts: 15,941
Threads: 0
Joined: Jun 2008
So, again, two of your cases have the same ID, I don\'t know whats so strange to understand about that.