Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5. // we return whether the menu was processed correctly
  6. bool processMenu() {
  7.     // show the user the menu
  8.     system("TITLE Trinity Core Server Starter");
  9.     cout <<" *******************************"<<endl;
  10.     cout <<"** Autor: Ags                  **"<<endl;
  11.     cout <<"** Spoluprace: WSS Hulakadlo   **"<<endl;
  12.     cout <<"** Version: 1.1                **"<<endl;
  13.     cout <<" *******************************"<<endl;
  14.     cout <<" "<<endl;
  15.     cout <<" ********************************"<<endl;
  16.     cout <<"** 1 - Start worldserver.exe    **"<<endl;
  17.     cout <<"** 2 - Start authserver.exe     **"<<endl;
  18.     cout <<"**------------------------------**"<<endl;
  19.     cout <<"** 0 - Exit                     **"<<endl;
  20.     cout <<" ********************************"<<endl;
  21.     cout <<" "<<endl;
  22.    
  23.     // get the response
  24.     char choice;
  25.     cin >> choice;
  26.    
  27.     // process the response
  28.     // do something for each valid option
  29.     if (choice=='1') {
  30.         cout << "Start worldserver.exe" <<endl;
  31.         cout << "OK" <<endl;
  32.         system("worldserver.exe");
  33.     } else if (choice=='2') {
  34.         cout << "Start authserver.exe" <<endl;
  35.         cout << "OK" <<endl;
  36.         system("authserver.exe");
  37.     } else if (choice=='0') {
  38.         exit;
  39.     } else {
  40.         // if we got this far, the response was not valid
  41.         return false;
  42.     }
  43.     return true;
  44. }
  45.  
  46. int main () {
  47.     // we loop until the menu is processed
  48.     while (!processMenu()) {
  49.         // if we get here, the menu was not processed correctly
  50.         // so we bother them some more
  51.         cout << "Nespravna volba!!!" << endl;
  52.         cout << "Prosim zkuste to znovu." << endl << endl << endl;
  53.     }
  54.     cout << endl << "Thank you for playing." << endl;
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement