SA-MP Forums Archive
Need little help << - 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: Need little help << (/showthread.php?tid=631762)



Need little help << - Jihanz - 04.04.2017

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


Re: Need little help << - Banditul18 - 04.04.2017

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


Re: Need little help << - Jihanz - 04.04.2017

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


Re: Need little help << - AndreiWow - 04.04.2017

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.


Re: Need little help << - Luis- - 04.04.2017

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.


Re: Need little help << - Vince - 04.04.2017

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.


Re: Need little help << - Jihanz - 04.04.2017

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


Re: Need little help << - Jihanz - 04.04.2017

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


Re: Need little help << - Luis- - 04.04.2017

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