Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- // we return whether the menu was processed correctly
- bool processMenu() {
- // show the user the menu
- system("TITLE Trinity Core Server Starter");
- cout <<" *******************************"<<endl;
- cout <<"** Autor: Ags **"<<endl;
- cout <<"** Spoluprace: WSS Hulakadlo **"<<endl;
- cout <<"** Version: 1.1 **"<<endl;
- cout <<" *******************************"<<endl;
- cout <<" "<<endl;
- cout <<" ********************************"<<endl;
- cout <<"** 1 - Start worldserver.exe **"<<endl;
- cout <<"** 2 - Start authserver.exe **"<<endl;
- cout <<"**------------------------------**"<<endl;
- cout <<"** 0 - Exit **"<<endl;
- cout <<" ********************************"<<endl;
- cout <<" "<<endl;
- // get the response
- char choice;
- cin >> choice;
- // process the response
- // do something for each valid option
- if (choice=='1') {
- cout << "Start worldserver.exe" <<endl;
- cout << "OK" <<endl;
- system("worldserver.exe");
- } else if (choice=='2') {
- cout << "Start authserver.exe" <<endl;
- cout << "OK" <<endl;
- system("authserver.exe");
- } else if (choice=='0') {
- exit;
- } else {
- // if we got this far, the response was not valid
- return false;
- }
- return true;
- }
- int main () {
- // we loop until the menu is processed
- while (!processMenu()) {
- // if we get here, the menu was not processed correctly
- // so we bother them some more
- cout << "Nespravna volba!!!" << endl;
- cout << "Prosim zkuste to znovu." << endl << endl << endl;
- }
- cout << endl << "Thank you for playing." << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement