duplicate "case"
#1

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(playeridDIALOG_PLAYER_TOY_DELETE_ALL);
                if(
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(playeriddialogid);
                return 
1;
                }
                
PLAYER_TEMP[playerid][pt_SELECTED_TOY_SLOT] = listitem;
                
ShowDialog(playeridDIALOG_PLAYER_TOY_MENU_DYO);
            }
            return 
1;
        } 
Wtf is wrong on this? :/
Thanks
Reply
#2

What instances of case do you have? Do they have the samel value?
Let us know how you defined the cases.
Reply
#3

That probably means that the constant value of

Код:
dRegistro
is equal to one of your dialogid's listed in enum.
Reply
#4

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.
Reply
#5

So, okay, thanks to all.
I solucionated this, moving all the dialogs to a enum.
Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)