title: "A case label may only be used within a switch"
body: <p>I am new to coding, and need some help with something. I am sorting out cases from a GTA Mod Menu, and trying to add a new one from an SDK. When I try to add it, and add a case for it so it knows what to do, I get the error in the title. I am coding in C++. </p>
  
  <pre><code>    int activeLineIndexVeh = 0;
  
  void process_veh_menu()
  {
      const float lineWidth = 230.0;
      const int lineCount = 9;
  
      std::string caption = "Vehicle Options";
  
      static struct {
          LPCSTR      text;
          bool        *pState;
          bool        *pUpdated;
      } lines[lineCount] = {
          { "Car Spawner", NULL, NULL },
          { "Random Paint", NULL, NULL },
          { "Fix", NULL, NULL },
          { "Custom Plate", NULL, NULL },
          { "Seat Belt", &amp;featureVehSeatbelt, &amp;featureVehSeatbeltUpdated },
          { "Wrap In Spawned", &amp;featureVehWrapInSpawned, NULL },
          { "Invincible", &amp;featureVehInvincible, &amp;featureVehInvincibleUpdated },
          { "Strong Wheels", &amp;featureVehInvincibleWheels, &amp;featureVehInvincibleWheelsUpdated },
          { "Speed Boost", &amp;featureVehSpeedBoost, NULL }
      };
  
      DWORD waitTime = 150;
      while (true)
      {
          // timed menu draw, used for pause after active line switch
          DWORD maxTickCount = GetTickCount() + waitTime;
          do
          {
              // draw menu
              draw_menu_line(caption, lineWidth, 7.9, 14.0, 4.0, 4.0, false, true);
              for (int i = 0; i &lt; lineCount; i++)
                  if (i != activeLineIndexVeh)
                      draw_menu_line(line_as_str(lines[i].text, lines[i].pState),
                      lineWidth, 4.0, 60.0 + i * 22.8, 4.0, 9.0, false, false);
              draw_menu_line(line_as_str(lines[activeLineIndexVeh].text, lines[activeLineIndexVeh].pState),
                  lineWidth + 0.0, 2.0, 60.0 + activeLineIndexVeh * 22.9, 4.0, 7.0, true, false);
  
              update_features();
              WAIT(0);
          } while (GetTickCount() &lt; maxTickCount);
          waitTime = 0;
  
          // process buttons
          bool bSelect, bBack, bUp, bDown;
          get_button_state(&amp;bSelect, &amp;bBack, &amp;bUp, &amp;bDown, NULL, NULL);
          if (bSelect)
          {
              menu_beep();
  
              // common variables
              BOOL bPlayerExists = ENTITY::DOES_ENTITY_EXIST(PLAYER::PLAYER_PED_ID());
              Player player = PLAYER::PLAYER_ID();
              Ped playerPed = PLAYER::PLAYER_PED_ID();
  
              switch (activeLineIndexVeh)
              {
              case 0:
                  if (process_carspawn_menu()) return;
                  break;
              case 1:
                  if (bPlayerExists)
                  {
                      if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
                      {
                          Vehicle veh = PED::GET_VEHICLE_PED_IS_USING(playerPed);
                          VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, rand() % 255, rand() % 255, rand() % 255);
                          if (VEHICLE::GET_IS_VEHICLE_PRIMARY_COLOUR_CUSTOM(veh))
                              VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(veh, rand() % 255, rand() % 255, rand() % 255);
                      }
                      else
                      {
                          set_status_text("player isn't in a vehicle");
                      }
                  }
                  break;
              case 2:
                  if (bPlayerExists)
                      if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0))
                          VEHICLE::SET_VEHICLE_FIXED(PED::GET_VEHICLE_PED_IS_USING(playerPed));
                      else
                          set_status_text("player isn't in a vehicle");
                  break;
                  // switchable features
              default:
                  if (lines[activeLineIndexVeh].pState)
                      *lines[activeLineIndexVeh].pState = !(*lines[activeLineIndexVeh].pState);
                  if (lines[activeLineIndexVeh].pUpdated)
                      *lines[activeLineIndexVeh].pUpdated = true;
              }
              waitTime = 200;
          }
          else
              if (bBack || trainer_switch_pressed())
              {
                  menu_beep();
                  break;
              }
              else
                  if (bUp)
                  {
                      menu_beep();
                      if (activeLineIndexVeh == 0)
                          activeLineIndexVeh = lineCount;
                      activeLineIndexVeh--;
                      waitTime = 150;
                  }
                  else
                      if (bDown)
                      {
                          menu_beep();
                          activeLineIndexVeh++;
                          if (activeLineIndexVeh == lineCount)
                              activeLineIndexVeh = 0;
                          waitTime = 150;
                      }
          case 3: // error starts here
              Ped playerPed = PLAYER::PLAYER_PED_ID();
  
              // No point in displaying the keyboard if they aren't in a vehicle
              if (!PED::IS_PED_IN_ANY_VEHICLE(playerPed, false)) return;
  
              // Invoke keyboard
              GAMEPLAY::DISPLAY_ONSCREEN_KEYBOARD(true, "", "", VEHICLE::GET_VEHICLE_NUMBER_PLATE_TEXT(PED::GET_VEHICLE_PED_IS_IN(playerPed, false)), "", "", "", 9);
  
              // Wait for the user to edit
              while (GAMEPLAY::UPDATE_ONSCREEN_KEYBOARD() == 0) WAIT(0);
  
              // Make sure they didn't exit without confirming their change, and that they're still in a vehicle
              if (!GAMEPLAY::GET_ONSCREEN_KEYBOARD_RESULT() || !PED::IS_PED_IN_ANY_VEHICLE(playerPed, false)) return;
  
              // Update the licenseplate
              VEHICLE::SET_VEHICLE_NUMBER_PLATE_TEXT(PED::GET_VEHICLE_PED_IS_IN(playerPed, false), GAMEPLAY::GET_ONSCREEN_KEYBOARD_RESULT());
      }
  }
  </code></pre>