SA-MP Forums Archive
please help me ! - 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: please help me ! (/showthread.php?tid=538730)



please help me ! - YanLanger - 23.09.2014

Errors.
pawn Код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\CpsNrbrs.pwn(262) : error 040: duplicate "case" label (value 29)
Code.
Код:
public OnPlayerSpawn(playerid)
{
IsPlayerPolice[playerid] = 0;
switch(GetPlayerSkin(playerid))
     {
         case 105 .. 107:
         {
              SetPlayerTeam(playerid, TEAM_GROVE);
              SetPlayerColor(playerid, COL_GREEN);
              }
              case 102 .. 104:
              {
                  SetPlayerTeam(playerid, TEAM_BALLAS);
                  SetPlayerColor(playerid, COL_PURPLE);
              }
              case 7 .. 73:
              {
				  SetPlayerColor(playerid, COLOR_WHITE);
			  }
              case 108 .. 110:
              {
                  SetPlayerTeam(playerid, TEAM_VAGOS);
                  SetPlayerColor(playerid, COL_YELLOW);
              }
              case 280 .. 285:
              {
                  SetPlayerTeam(playerid, TEAM_POLICE);
                  SetPlayerColor(playerid, COLOR_BLUE);
                  IsPlayerPolice[playerid] = 1;
              }
              case 29 .. 100:
              {
                  SetPlayerTeam(playerid, TEAM_DRUGDEALERS);
                  SetPlayerColor(playerid, COL_RED);
              }
              case 114 .. 116:
              {
                  SetPlayerTeam(playerid, TEAM_AZTECAS);
                  SetPlayerColor(playerid, COL_LIGHTBLUE);
              }
      }
return 1;
}



Re: please help me ! - YanLanger - 23.09.2014

Ahmm explain little more :P


Re: please help me ! - Ghazal - 23.09.2014

You are using the case 29 two times and you should use it only one time.


Re: please help me ! - Ox1gEN - 23.09.2014

7 .. 73

29 .. 100

There are 30, 31, 32, and so on in both cases.


Re: please help me ! - YanLanger - 23.09.2014

You mean

case 29 .. 100:
{
SetPlayerTeam(playerid, TEAM_BLAH);
SetPlayerColor(playerid, COL_BLAH);
}

Two times? cause i see it only once lol
EDIT: ohhhhhh ookkkk


Re: please help me ! - Ox1gEN - 23.09.2014

lol...


Let me explain it to you better.

When you do case 29 .. 100 do you actually know what it means?
It means what'll happen between the 29th case and the 100th case.

And when you do 7 .. 73 it does the same.

So if you think of it there are the SAME numbers inside both cases.
Because in 7 .. 73 there are 50, 51, 52, 53, and so on.

And in 29 .. 100 There are also the cases 50, 51, 52, 53 and so on.

Understood?


Re: please help me ! - YanLanger - 23.09.2014

oh yes, so how do i fix it ?


Re: please help me ! - Ox1gEN - 23.09.2014

Do instead of 7 .. 73 do:

7 .. 28


Re: please help me ! - YanLanger - 23.09.2014

oh Thank you bro.