Vizik's LOCHelper (For H1Z1)
This tool will guide you in which direction you should be facing. Select a major city/area, enter x/z coords and try to match the heading it gives you.
It isn't really accurate, it will give you a vague 90 degrees so there's no absolute guarantee it will give you satisfying results.
I apologize in advance since I am a beginner but I hope this will be helpful or atleast a little interesting... or something to laugh at. Enjoy
Code:
//Vizik's LOCHelper
#include <iostream>
#include <string>
using namespace std;
void headingCal(int cityXCoord,int cityYCoord);
void area(char menuOption);
void headingCal(int cityXCoord,int cityYCoord)
{
int xCoord;
int yCoord;
string SN;// Will be set to North or South and will output
string EW;
string snHeading; //Gives the proper heading for North/South
string ewHeading;
cout << "Enter your x: ";
cin >> xCoord;
cout << "Enter your z; ";
cin >> yCoord;
if (xCoord >= cityXCoord){
SN = "South";
snHeading = "-1.5";
}
else if (xCoord <= cityXCoord){
SN = "North";
snHeading = "1.5";
}
if (yCoord >= cityYCoord){
EW = "East";
ewHeading = "0.0";
}
else if (yCoord <= cityYCoord){
EW = "West";
ewHeading = "-3.1";
}
cout << "Head " << SN << " " << EW << "." << endl;
cout << "Your heading should be between " << snHeading << " and " << ewHeading << "." << endl;
}
void area(char menuOption)
{
int xCoord [5] = {0, 1000, -900, -1900, -1300};
int yCoord [5] = {-1000, 2700, 2700, -2200, 1700};
switch (menuOption) {
case 'P':
cout << "PleasantValley:" << endl;
headingCal(xCoord[1], yCoord[1]);
break;
case 'V':
cout << "VillasDevelopment:" << endl;
headingCal(xCoord[2], yCoord[2]);
break;
case 'L':
cout << "LonePineDevelopment:" << endl;
headingCal(xCoord[3], yCoord[3]);
break;
case 'H':
cout << "HerringTruckStop:" << endl;
headingCal(xCoord[4], yCoord[4]);
break;
case 'T':
cout << "Tamatama" << endl;
headingCal(xCoord[5], yCoord[5]);
break;
}
}
int main()
{
cout << "Vizik's LOCHelper" << endl << endl;
bool menuRun = true;
cout << "_________[Menu]________" << endl;
cout << "|[P]easantValley |" << endl;
cout << "|[V]illasDevelopment |" << endl;
cout << "|[L]onePineDevelopment |" << endl;
cout << "|[H]erringTruckstop |" << endl;
cout << "|[T]amatama(Cranberry) |" << endl;
cout << "|[E]xit |" << endl;
cout << "|______________________|" << endl;
while (menuRun == true){
char menuOption;
cin >> menuOption; //Takes user's input
menuOption = toupper(menuOption);//Sets char to uppercase
if (menuOption == 'E') //If user enters e or E the program will stop
{
menuRun = false;
}
area(menuOption);
}
return 0;
}