Need little help <<
#1

Can you help me i got new error

Код:
D:\data aji\Samp server\gamemodes\fr1.pwn(3716) : error 040: duplicate "case" label (value 15)
this my line
PHP код:
      case DIALOG_MALESKIN:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0:{ SetPlayerSkin(playerid,2);  PlayerInfo[playerid][pSkin] = 2; }
                    case 
1:{ SetPlayerSkin(playerid,23); PlayerInfo[playerid][pSkin] = 23; }
                    case 
2:{ SetPlayerSkin(playerid,29); PlayerInfo[playerid][pSkin] = 29; }
                }
            }
        } 
Thanks Before
Reply
#2

Make sure that you don't have 2 or more dialogs with id 15 ( 2 defines of dialogs that have value 15)
Reply
#3

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
Make sure that you don't have 2 or more dialogs with id 15 ( 2 defines of dialogs that have value 15)
lol solved with me just add +1 in dialog

example
PHP код:
case DIALOG_MALESKIN+
BTW thanks for your comment
Reply
#4

You could just change the name to something else, like DIALOG_MALESKIN2 instead of +2, you will also have to change its name everywhere else in the script or it won't work properly.
Reply
#5

Quote:
Originally Posted by Jihanz
Посмотреть сообщение
lol solved with me just add +1 in dialog

example
PHP код:
case DIALOG_MALESKIN+
BTW thanks for your comment
That'll no doubt fuck up your code if you keep +1'ing it. Say you have a dialog id of 10, and you plus 1 dialog id 10, it'll become 11 right? Then you define a dialog with the id of 11, it'll conflict.
Reply
#6

Constant math is processed at a compile time so the compiler will just complain again. Better to use an enum to define your dialogids. No chance of conflict.
Reply
#7

Quote:
Originally Posted by Luis-
Посмотреть сообщение
That'll no doubt fuck up your code if you keep +1'ing it. Say you have a dialog id of 10, and you plus 1 dialog id 10, it'll become 11 right? Then you define a dialog with the id of 11, it'll conflict.
sorry i hate ur comment
Reply
#8

Quote:
Originally Posted by AndreiWow
Посмотреть сообщение
You could just change the name to something else, like DIALOG_MALESKIN2 instead of +2, you will also have to change its name everywhere else in the script or it won't work properly.
Thanks Bro i +rep you
Reply
#9

Quote:
Originally Posted by Jihanz
Посмотреть сообщение
sorry i hate ur comment
Hate it, love it, I really don't care. It's logic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)