Can someone make me a hack where it changes the enemies name to something like bright green. Or any hex color of the choosing.
Code:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int convertFromHex(string hex)
{
int value = 0;
int a = 0;
int b = hex.length() - 1;
for (; b >= 0; a++, b--)
{
if (hex[b] >= '0' && hex[b] <= '9')
{
value += (hex[b] - '0') * (1 << (a * 4));
}
else
{
switch (hex[b])
{
case 'A':
case 'a':
value += 10 * (1 << (a * 4));
break;
case 'B':
case 'b':
value += 11 * (1 << (a * 4));
break;
case 'C':
case 'c':
value += 12 * (1 << (a * 4));
break;
case 'D':
case 'd':
value += 13 * (1 << (a * 4));
break;
case 'E':
case 'e':
value += 14 * (1 << (a * 4));
break;
case 'F':
case 'f':
value += 15 * (1 << (a * 4));
break;
default:
cout << "Error, invalid charactare '" << hex[a] << "' in hex number" << endl;
break;
}
}
}
return value;
}
void hextodec(string hex, vector<unsigned char>& rgb)
{
// since there is no prefix attached to hex, use this code
string redString = hex.substr(0, 2);
string greenString = hex.substr(2, 2);
string blueString = hex.substr(4, 2);
/*
if the prefix # was attached to hex, use the following code
string redString = hex.substr(1, 2);
string greenString = hex.substr(3, 2);
string blueString = hex.substr(5, 2);
*/
/*
if the prefix 0x was attached to hex, use the following code
string redString = hex.substr(2, 2);
string greenString = hex.substr(4, 2);
string blueString = hex.substr(6, 2);
*/
unsigned char red = (unsigned char)(convertFromHex(redString));
unsigned char green = (unsigned char)(convertFromHex(greenString));
unsigned char blue = (unsigned char)(convertFromHex(blueString));
rgb[0] = red;
rgb[1] = green;
rgb[2] = blue;
}
int main()
{
string hexColor;
vector<unsigned char> rgbColor(3);
cout << "Enter Hex value (must be 6 valid Hex digits): 0x";
cin >> hexColor;
hextodec(hexColor, rgbColor);
cout << "\nWhen 0x" << hexColor << " is converted to RGB, it becomes:" << endl;
cout << "R: " << int(rgbColor[0]) << endl;
cout << "G: " << int(rgbColor[1]) << endl;
cout << "B: " << int(rgbColor[2]) << endl;
system("pause");
}
Found the code gamdev if thats any help
Been a while since I officially made a Hex to RGB but if you can make this mod where it brightens up the color that would own, maybe text file setting? (It sucks when shooting at wrong guy when my partners are near me In Close Combat)