Facebook
From Mia, 1 Month ago, written in C++.
Embed
Download Paste or View Raw
Hits: 124
  1. #include <iostream>
  2. #include <map>
  3. #include <string>
  4.  
  5. // Define a struct to represent a cheat option
  6. struct CheatOption {
  7.     std::string name;
  8.     bool enabled;
  9.  
  10.     CheatOption(std::string n) : name(n), enabled(false) {}
  11.  
  12.     void toggle() {
  13.         enabled = !enabled;
  14.     }
  15. };
  16.  
  17. // Define a map of cheat options
  18. std::map<std :string, CheatOption> cheatOpti
  19.     {"Beam Deform", CheatOption("BeamDeform")},
  20.     {"Time Delay", CheatOption("timeDelay")},
  21.     {"Control", CheatOption("control")}
  22. };
  23.  
  24. // Function to display the cheat menu
  25. void displayCheatMenu() {
  26.     std::cout << "============ BEAMNG.Drive Cheat Menu ============\n";
  27.     for (const auto& option : cheatOptions) {
  28.         std::cout << option.first << ": " << (option.second.enabled ? "ON" : "OFF") << "\n";
  29.     }
  30.     std::cout << "==============================================\n";
  31. }
  32.  
  33. // Function to enable/disable a cheat option
  34. void toggleCheatOption(std::string optionName) {
  35.     if (cheatOptions.find(optionName) != cheatOptions.end()) {
  36.         cheatOptions[optionName].toggle();
  37.     }
  38. }
  39.  
  40. int main() {
  41.     // Game loop
  42.     while (true) {
  43.         // Display the cheat menu
  44.         displayCheatMenu();
  45.  
  46.         // Get user input
  47.         std::cout << "Enter a cheat option to toggle (or 'exit' to quit): ";
  48.         std::string input;
  49.         std::cin >> input;
  50.  
  51.         if (input == "exit") {
  52.             break;
  53.         }
  54.  
  55.         // Toggle the cheat option
  56.         toggleCheatOption(input);
  57.     }
  58.  
  59.     return 0;
  60. }