duplicate "case" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: duplicate "case" (
/showthread.php?tid=641804)
duplicate "case" -
Dello - 20.09.2017
Hi! I use Optimus gamemode, and i going to add a Toys System of "SuperRoleplay" GM.
I defined "DIALOG_PLAYER_TOYS" by enum, with other dialogs.
I use the "DIALOG_PLAYER_TOYS" in two publics: "ShowDialog(playerid)" and "OnDialogResponse".
The error is in other dialog:
Код:
C:\Users\Dello\Desktop\Contenedor\Optimus-Roleplay-V3-master\gamemodes\backup 12-9-17\ajam\optimusv3.pwn(22486) : error 040: duplicate "case" label (value 1)
C:\Users\Dello\Desktop\Contenedor\Optimus-Roleplay-V3-master\gamemodes\backup 12-9-17\ajam\optimusv3.pwn(26261) : error 040: duplicate "case" label (value 2)
Line:
PHP код:
//22486 case dRegistro:
//22487 {
So, up (above) of this code, i put the dialog "DIALOG_PLAYER_TOYS"
PHP код:
case DIALOG_PLAYER_TOYS:
{
if(response)
{
if(listitem == MAX_PLAYER_ATTACHED_OBJECTS) return ShowDialog(playerid, DIALOG_PLAYER_TOY_DELETE_ALL);
if(0 < InfoJugador[playerid][jCuentaSU] && listitem >= MAX_NU_TOYS)
{
SendClientMessageEx(playerid, -1, "{CCCCCC}ЎLos jugadores {b1fc6f}VIP {CCCCCC}pueden tener hasta %d accesorios! Usa {fffb49}/ayuda {CCCCCC}si quieres ser {b1fc6f}VIP.", MAX_PLAYER_ATTACHED_OBJECTS);
ShowDialog(playerid, dialogid);
return 1;
}
PLAYER_TEMP[playerid][pt_SELECTED_TOY_SLOT] = listitem;
ShowDialog(playerid, DIALOG_PLAYER_TOY_MENU_DYO);
}
return 1;
}
Wtf is wrong on this? :/
Thanks
Re: duplicate "case" -
Twizted - 21.09.2017
What instances of
case do you have? Do they have the samel value?
Let us know how you defined the cases.
Re: duplicate "case" -
marsl9 - 21.09.2017
That probably means that the constant value of
is equal to one of your dialogid's listed in enum.
Re: duplicate "case" -
!R1Ch@rD! - 21.09.2017
change the number
Код:
#define DIALOG_PLAYER_TOYS 10
#define dRegistro 11
It depends on what number you have in your GM, maybe it will help you.
Re: duplicate "case" -
Dello - 22.09.2017
So, okay, thanks to all.
I solucionated this, moving all the dialogs to a enum.
Thanks!