please help me !
#1

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;
}
Reply
#2

Ahmm explain little more :P
Reply
#3

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

7 .. 73

29 .. 100

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

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
Reply
#6

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?
Reply
#7

oh yes, so how do i fix it ?
Reply
#8

Do instead of 7 .. 73 do:

7 .. 28
Reply
#9

oh Thank you bro.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)