Error 002:
#1

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    SetPlayerCameraPos(playerid, 2220.9197,-1164.0920,25.7331);
    SetPlayerCameraLookAt(playerid, 2215.1963,-1164.0492,25.7266);
    SetPlayerPos(playerid, 2215.1963,-1164.0492,25.7266);
    SetPlayerFacingAngle(playerid, 270.5322);
    ApplyAnimation(playerid,"DANCING","DAN_LOOP_A",4.0,1,0,0,0,-1);
    switch(classid) // Switching between the classids
    {
         case 0..2:
         {
              SetPlayerTeam(playerid, TEAM_AZTECAS); // Setting players team
              GameTextForPlayer(playerid, "~w~[]AZTECAS[]", 2000, 5); // Screen msg for player to show what team
         }
         case 3..5:
         {
              SetPlayerTeam(playerid, TEAM_VAGO); // Setting players team
              GameTextForPlayer(playerid, "~y~[]Vagos[]", 2000, 5); // Screen msg for player to show what team
         }
         case 6..11:
         {
              SetPlayerTeam(playerid, TEAM_GROVE); // Setting players team
              GameTextForPlayer(playerid,"~g~[]Grove[]",  2000,5); // Screen msg for player to show what team
         }
         case 12..14:
         {
              SetPlayerTeam(playerid, TEAM_BALLA); // Setting players team
              GameTextForPlayer(playerid,"~p~[]Balla[]",2000,5); // Screen msg for player to show what team
         }
         case 15..16:
         {
              SetPlayerTeam(playerid, TEAM_BIKER); // Setting players team
              GameTextForPlayer(playerid,"~l~[]BIKER[]",2000,5); // Screen msg for player to show what team
         }
         case 17..19:
         {
              SetPlayerTeam(playerid, TEAM_MEDIC); // Setting players team
              GameTextForPlayer(playerid,"~w~[]Medic[]",2000,5); // Screen msg for player to show what team
         }
         case 20..22:
         {
              SetPlayerTeam(playerid, TEAM_WHORE); // Setting players team
              GameTextForPlayer(playerid,"~r~[]Whore[]",2000,5); // Screen msg for player to show what team
         }
         case 23..25:
         {
              SetPlayerTeam(playerid, TEAM_COPS); // Setting players team
              GameTextForPlayer(playerid,"~b~[]Cops[]",2000,5); // Screen msg for player to show what team
         }
         case 26..27:
         {
              SetPlayerTeam(playerid, TEAM_INDIAN); // Setting players team
              GameTextForPlayer(playerid,"~w~[]Indian[]",2000,5); // Screen msg for player to show what team
         }
         case 28..30:
         {
              SetPlayerTeam(playerid, TEAM_FBI); // Setting players team
              GameTextForPlayer(playerid,"~w~[]FBI[]",200,5); // Screen msg for player to show what team
              }
              else//line 3079!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
              {
              if (GetPlayerScore(playerid) < 50)
              {
                    GameTextForPlayer(playerid,"~r~You must have 50 Scores to be FBI",6500,6);
              }
         }
    }
    return 1;
}
Error:
Код:
(3079) : error 002: only a single statement (or expression) can follow each "case"
Reply
#2

[pawn]
]
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    SetPlayerCameraPos(playerid, 2220.9197,-1164.0920,25.7331);
    SetPlayerCameraLookAt(playerid, 2215.1963,-1164.0492,25.7266);
    SetPlayerPos(playerid, 2215.1963,-1164.0492,25.7266);
    SetPlayerFacingAngle(playerid, 270.5322);
    ApplyAnimation(playerid,"DANCING","DAN_LOOP_A",4.0,1,0,0,0,-1);
    switch(classid) // Switching between the classids
    {
         case 0..2:
         {
              SetPlayerTeam(playerid, TEAM_AZTECAS); // Setting players team
              GameTextForPlayer(playerid, "~w~[]AZTECAS[]", 2000, 5); // Screen msg for player to show what team
         }
         case 3..5:
         {
              SetPlayerTeam(playerid, TEAM_VAGO); // Setting players team
              GameTextForPlayer(playerid, "~y~[]Vagos[]", 2000, 5); // Screen msg for player to show what team
         }
         case 6..11:
         {
              SetPlayerTeam(playerid, TEAM_GROVE); // Setting players team
              GameTextForPlayer(playerid,"~g~[]Grove[]",  2000,5); // Screen msg for player to show what team
         }
         case 12..14:
         {
              SetPlayerTeam(playerid, TEAM_BALLA); // Setting players team
              GameTextForPlayer(playerid,"~p~[]Balla[]",2000,5); // Screen msg for player to show what team
         }
         case 15..16:
         {
              SetPlayerTeam(playerid, TEAM_BIKER); // Setting players team
              GameTextForPlayer(playerid,"~l~[]BIKER[]",2000,5); // Screen msg for player to show what team
         }
         case 17..19:
         {
              SetPlayerTeam(playerid, TEAM_MEDIC); // Setting players team
              GameTextForPlayer(playerid,"~w~[]Medic[]",2000,5); // Screen msg for player to show what team
         }
         case 20..22:
         {
              SetPlayerTeam(playerid, TEAM_WHORE); // Setting players team
              GameTextForPlayer(playerid,"~r~[]Whore[]",2000,5); // Screen msg for player to show what team
         }
         case 23..25:
         {
              SetPlayerTeam(playerid, TEAM_COPS); // Setting players team
              GameTextForPlayer(playerid,"~b~[]Cops[]",2000,5); // Screen msg for player to show what team
         }
         case 26..27:
         {
              SetPlayerTeam(playerid, TEAM_INDIAN); // Setting players team
              GameTextForPlayer(playerid,"~w~[]Indian[]",2000,5); // Screen msg for player to show what team
         }
         case 28..30:
         {
            if(GetPlayerScore(playerid) > 49)
            {
              SetPlayerTeam(playerid, TEAM_FBI); // Setting players team
              GameTextForPlayer(playerid,"~w~[]FBI[]",200,5); // Screen msg for player to show what team
            }
            else
            {
                GameTextForPlayer(playerid,"~r~You must have 50 Scores to be FBI",6500,6);
            }
         }
    }
    return 1;
}
You will have lose indentation errors
Reply
#3

what was the problem? BTw its fixed but i need to know the problem so i dont make a mistake in future
Reply
#4

pawn Код:
case 28..30:
         {
            if(GetPlayerScore(playerid) > 49)
            {
              SetPlayerTeam(playerid, TEAM_FBI); // Setting players team
              GameTextForPlayer(playerid,"~w~[]FBI[]",200,5); // Screen msg for player to show what team
            }
            else //you had the " else " in use for case, and case can't have else..
            {
                GameTextForPlayer(playerid,"~r~You must have 50 Scores to be FBI",6500,6);
            }
         }
    }
    return 1;
}
this
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)