Facebook
From Mia, 1 Month ago, written in C++.
Embed
Download Paste or View Raw
Hits: 132
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. // Define a struct to represent a cheat/mod option
  6. struct CheatOrModOption {
  7.     std::string name;
  8.     bool enabled;
  9.  
  10.     CheatOrModOption(std::string n) : name(n), enabled(false) {}
  11.  
  12.     void toggle() {
  13.         enabled = !enabled;
  14.     }
  15. };
  16.  
  17. // Define a map of cheat/mod options
  18. const std::map<std :string, CheatOrModOption> cheatOrModOpti
  19.     {"beam_deform", CheatOrModOption("BeamDeform")},
  20.     {"time_delay", CheatOrModOption("Time Delay")},
  21.     {"control", CheatOrModOption("Control")},
  22.     {"road_spikes", CheatOrModOption("Road Spikes")},
  23.     {"car_turbos", CheatOrModOption("Car Turbos")},
  24.     {"monster_trucks", CheatOrModOption("Monster Trucks")}
  25. };
  26.  
  27. // Function to display the admin panel
  28. void displayAdminPanel() {
  29.     std::cout << "======== BEAMNG.Drive Admin Panel ========n";
  30.     for (const auto& option : cheatOrModOptions) {
  31.         std::cout << option.first << ": " << (option.second.enabled ? "ON" : "OFF") << "n";
  32.     }
  33.     std::cout << "==================================n";
  34. }
  35.  
  36. // Function to enable/disable a cheat/mod option
  37. void toggleCheatOrModOption(const std::string& optionName) {
  38.     auto it = cheatOrModOptions.find(optionName);
  39.     if (it != cheatOrModOptions.end()) {
  40.         it->second.toggle();
  41.     } else {
  42.         std::cout << "Invalid option name: " << optionName << "n";
  43.     }
  44. }