//Huds:
namespace Huds
{
enum Struct
{
X = 0x00,
Y = 0x04,
Z = 0x08,
fontscale = 0xC,
color = 0x10,
sort = 0x38,
glowColor = 0x3C,
targetEntNum = 0x70,
label = 0x48,
width = 0x4A,
height = 0x4C,
text = 0x56,
type = 0x64,
font = 0x65,
materialIndex = 0x68,
ui3dWindow = 0x6D,
fromColor = 20,
fadeStartTime = 24,
scaleStartTime = 28,
fromX = 32,
fromY = 36,
moveStartTime = 40,
time = 44,
duration = 48,
value = 52,
fxBirthTime = 64,
fromWidth = 78,
fromHeight = 80,
scaleTime = 82,
moveTime = 84,
fxLetterTime = 88,
fxDecayStartTime = 90,
fxDecayDuration = 92,
fxRedactDecayStartTime = 94,
fxRedactDecayDuration = 96,
flags = 98,
alignOrg = 102,
alignScreen = 103,
offscreenMaterialIdx = 105,
fromAlignOrg = 106,
fromAlignScreen = 107,
soundID = 108,
unknown = 110
};
namespace MenuIDs
{
int NewsBar[12];
int NewsbarUpLine[12];
int NewsbarBG[12];
int NewsbarUnLine[12];
int Scrollbar[12];
int Shader[12];
int Sidebar[12];
int Sidebar2[12];
int MenuTitle[12];
int OptionsText[12];
int MenuName[12];
int Creator[12];
char* MenuOptionText[12];
char* MenuTitleText[12];
char* CreatorText[12];
char* NewsBarText[12];
int PlayerVerification[12];
}
enum Verification
{
unverified,
verified,
vip,
host
};
void ChangeVerification(int clientIndex, Verification VerificationLevel)
{
MenuIDs:layerVerification[clientIndex] = (int)VerificationLevel;
}
enum TypewriterTextTypes
{
Normal = 0x800,//fix
Classic = 0x4000
};
int G_LocalizedStringIndex(char* txt)
{
opd_s GLS = { 0x00370638, TOC };
int(*GLSI)(char* txt) = (int(*)(char*))&GLS;
return GLSI(txt);
}
int GetLevelTime()
{
return *(int*)(Offsets::Level_Time);
}
int GetLevelTime1()
{
return *(int*)0x011E7889;
}
int HudElem_Alloc()
{
for (int client = 0; client < 12; client++)
{
for (int i = 150; i < 1024; i++)
{
unsigned int address = (0x11F26D4 + (client * 0x2A3 + (i * 0x7C));
char* Buffer = ReadBytes(address, 4);
if (Buffer[0] == 0x00)
{
*(int*)(address + Huds::type) = 0x7C;
return address;
}
}
}
return 1023;
}
int SetShader(int client, char Material, short Width, short Height, float x, float y, int r = 255, int g = 255, int b = 255, int a = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 8;
*(short*)(Element + Huds::height) = Height;
*(short*)(Element + Huds::width) = Width;
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(float*)(Element + Huds::sort) = 0;
*(int*)(Element + Huds::targetEntNum) = client;
*(char*)(Element + Huds::materialIndex) = Material;
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
int SetText(int client, char* text, float x, float y, int Allign, int AllignOrg, float fontsize, char font, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 1;
*(int*)(Element + Huds::targetEntNum) = client;
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(int*)(Element + Huds::alignScreen) = Allign;
*(int*)(Element + Huds::alignOrg) = AllignOrg;
*(float*)(Element + Huds::fontscale) = fontsize;
*(char*)(Element + Huds::font) = font ;
*(char*)(Element + Huds::color) = r ;
*(char*)(Element + Huds::color + 0x01) = g ;
*(char*)(Element + Huds::color + 0x02) = b ;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::glowColor) = glowr;
*(char*)(Element + Huds::glowColor + 0x01) = glowg ;
*(char*)(Element + Huds::glowColor + 0x02) = glowb ;
*(char*)(Element + Huds::glowColor + 0x03) = glowa ;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
void ChangeHUDColor(int Element, int r, int g, int b, int a)
{
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
}
void ChangeMaterial(int Element, char Material)
{
*(char*)(Element + Huds::materialIndex) = Material;
}
void MoveShaderX(unsigned int Element, float x)
{
*(float*)(Element + Huds::X) = x;
}
void MoveShaderXY(unsigned int Element, float x, float y)
{
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
}
int SetTypewriter(int clientIndex, char* Text, int Font, float FontSize, float X, float Y, int Type = Normal, short Lettertime = 200, short fxDecayStartTime = 7000, short fxDecayDuration = 1000, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 0)
{
int elemIndex = SetText(clientIndex, Text, X, Y, FontSize, Font, r, g, b, a, glowr, glowg, glowb, glowa);
*(int*)(elemIndex + Huds::flags) = Type;
*(int*)(elemIndex + Huds::fxBirthTime) = GetLevelTime();
*(short*)(elemIndex + Huds::fxLetterTime) = Lettertime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(short*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
return elemIndex;
}
void DestroyAllElems()
{
for (unsigned int i = 0; i < 1024; i++)
{
char input[0x7C];
WriteBytes(0x11F26D4 + (i * 0x7C), input, 0x7C);
}
}
int GetHost()
{
char* str = ReadString(0x02000934);
for (int i = 0; i < 12; i++)
{
char* str2 = ReadString(0x013978d0 + (i * 0x2A3);
if (str == str2)
{
return i;
}
}
return -1;
}
void MoveOverTime1(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime1();
*(int*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void MoveOverTime(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime();
*(short*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void FadeOverTime(int elemIndex, short Time, int R = 0, int G = 0, int B = 0, int A = 0)
{
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { R, G, B, A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void FadeGlowOverTimez(int elemIndex, short Time, int RG = 0, int GG = 0, int BG = 0, int A = 0)
{
*(int*)(elemIndex + Huds::glowColor) = *(int*)(elemIndex + Huds::glowColor);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { RG, GG, BG, A };
WriteBytes(elemIndex + Huds::glowColor, ColorArray, 4);
}
void MoveHudOverTime(int elemIndex, float X)
{
WriteFloat(elemIndex + Huds::X, X);
}
void FadeAlphaOverTime(int elemIndex, short Time, char A = 0)
{
char* readColorArray = ReadBytes(elemIndex + Huds::color, 3);
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { readColorArray[0], readColorArray[1], readColorArray[2], A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void ScaleOverTime(int elemIndex, short time, short width, short height)
{
*(short*)(elemIndex + Huds::fromHeight) = *(short*)(elemIndex + Huds::height);
*(short*)(elemIndex + Huds::fromWidth) = *(short*)(elemIndex + Huds::width);
*(int*)(elemIndex + Huds::scaleStartTime) = GetLevelTime();
*(short*)(elemIndex + Huds::scaleTime) = time;
*(short*)(elemIndex + Huds::width) = width;
*(short*)(elemIndex + Huds::height) = height;
}
void FontScaleOverTime(int elemIndex, float FontSize, short time)
{
/*(float*)(elemIndex + Huds::fromfrontscale) = *(float*)(elemIndex + Huds::fontscale);
*(int*)(elemIndex + Huds::fontscalestarttime) = GetLevelTime();
*(short*)(elemIndex + Huds::fontScaleTime) = time;
*(float*)(elemIndex + Huds::fontscale) = FontSize;*/
}
void ChangeText(int Element, char* text)
{
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
}
}
/*void doTypewriterText(int elemIndex, int clientIndex, const char * text, float x, float y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, color_s color, color_s glowColor)
{
int * levelTime = (int*)0x0012E0304;
int SetText(Elem, clientIndex, "", 4, 1.9f, x, y, 0x05, 0x91);
*(int*)(elemIndex + Huds::fxBirthTime) = *levelTime;
*(int*)(elemIndex + Huds::fxLetterTime) = fxLetterTime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(float*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
*(int*)(elemIndex + Huds::color) = color;
*(int*)(elemIndex + Huds::glowColor) = glowColor;
setFlagForeground(elem);
*(int*)(elemIndex + Huds::text) = G_LocalizedStringIndex(text);
}*/
//Menu Huds:
int Title[12];//12 = Number of clients
int Options[12];
int Background[12][2];//2 = 2 Background
int Scrollbar[12];
//Huds:
namespace Huds
{
enum Struct
{
X = 0x00,
Y = 0x04,
Z = 0x08,
fontscale = 0xC,
color = 0x10,
sort = 0x38,
glowColor = 0x3C,
targetEntNum = 0x70,
label = 0x48,
width = 0x4A,
height = 0x4C,
text = 0x56,
type = 0x64,
font = 0x65,
materialIndex = 0x68,
ui3dWindow = 0x6D,
fromColor = 20,
fadeStartTime = 24,
scaleStartTime = 28,
fromX = 32,
fromY = 36,
moveStartTime = 40,
time = 44,
duration = 48,
value = 52,
fxBirthTime = 64,
fromWidth = 78,
fromHeight = 80,
scaleTime = 82,
moveTime = 84,
fxLetterTime = 88,
fxDecayStartTime = 90,
fxDecayDuration = 92,
fxRedactDecayStartTime = 94,
fxRedactDecayDuration = 96,
flags = 98,
alignOrg = 102,
alignScreen = 103,
offscreenMaterialIdx = 105,
fromAlignOrg = 106,
fromAlignScreen = 107,
soundID = 108,
unknown = 110
};
namespace MenuIDs
{
int NewsBar[12];
int NewsbarUpLine[12];
int NewsbarBG[12];
int NewsbarUnLine[12];
int Scrollbar[12];
int Shader[12];
int Sidebar[12];
int Sidebar2[12];
int MenuTitle[12];
int OptionsText[12];
int MenuName[12];
int Creator[12];
char* MenuOptionText[12];
char* MenuTitleText[12];
char* CreatorText[12];
char* NewsBarText[12];
int PlayerVerification[12];
}
enum Verification
{
unverified,
verified,
vip,
host
};
void ChangeVerification(int clientIndex, Verification VerificationLevel)
{
MenuIDs:layerVerification[clientIndex] = (int)VerificationLevel;
}
enum TypewriterTextTypes
{
Normal = 0x800,//fix
Classic = 0x4000
};
int G_LocalizedStringIndex(char* txt)
{
opd_s GLS = { 0x00370638, TOC };
int(*GLSI)(char* txt) = (int(*)(char*))&GLS;
return GLSI(txt);
}
int GetLevelTime()
{
return *(int*)(Offsets::Level_Time);
}
int GetLevelTime1()
{
return *(int*)0x011E7889;
}
int HudElem_Alloc()
{
for (int client = 0; client < 12; client++)
{
for (int i = 150; i < 1024; i++)
{
unsigned int address = (0x11F26D4 + (client * 0x2A3 + (i * 0x7C));
char* Buffer = ReadBytes(address, 4);
if (Buffer[0] == 0x00)
{
*(int*)(address + Huds::type) = 0x7C;
return address;
}
}
}
return 1023;
}
int SetShader(int client, char Material, short Width, short Height, float x, float y, int r = 255, int g = 255, int b = 255, int a = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 8;
*(short*)(Element + Huds::height) = Height;
*(short*)(Element + Huds::width) = Width;
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(float*)(Element + Huds::sort) = 0;
*(int*)(Element + Huds::targetEntNum) = client;
*(char*)(Element + Huds::materialIndex) = Material;
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
int SetText(int client, char* text, float x, float y, int Allign, int AllignOrg, float fontsize, char font, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 1;
*(int*)(Element + Huds::targetEntNum) = client;
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(int*)(Element + Huds::alignScreen) = Allign;
*(int*)(Element + Huds::alignOrg) = AllignOrg;
*(float*)(Element + Huds::fontscale) = fontsize;
*(char*)(Element + Huds::font) = font ;
*(char*)(Element + Huds::color) = r ;
*(char*)(Element + Huds::color + 0x01) = g ;
*(char*)(Element + Huds::color + 0x02) = b ;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::glowColor) = glowr;
*(char*)(Element + Huds::glowColor + 0x01) = glowg ;
*(char*)(Element + Huds::glowColor + 0x02) = glowb ;
*(char*)(Element + Huds::glowColor + 0x03) = glowa ;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
void ChangeHUDColor(int Element, int r, int g, int b, int a)
{
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
}
void ChangeMaterial(int Element, char Material)
{
*(char*)(Element + Huds::materialIndex) = Material;
}
void MoveShaderX(unsigned int Element, float x)
{
*(float*)(Element + Huds::X) = x;
}
void MoveShaderXY(unsigned int Element, float x, float y)
{
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
}
int SetTypewriter(int clientIndex, char* Text, int Font, float FontSize, float X, float Y, int Type = Normal, short Lettertime = 200, short fxDecayStartTime = 7000, short fxDecayDuration = 1000, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 0)
{
int elemIndex = SetText(clientIndex, Text, X, Y, FontSize, Font, r, g, b, a, glowr, glowg, glowb, glowa);
*(int*)(elemIndex + Huds::flags) = Type;
*(int*)(elemIndex + Huds::fxBirthTime) = GetLevelTime();
*(short*)(elemIndex + Huds::fxLetterTime) = Lettertime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(short*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
return elemIndex;
}
void DestroyAllElems()
{
for (unsigned int i = 0; i < 1024; i++)
{
char input[0x7C];
WriteBytes(0x11F26D4 + (i * 0x7C), input, 0x7C);
}
}
int GetHost()
{
char* str = ReadString(0x02000934);
for (int i = 0; i < 12; i++)
{
char* str2 = ReadString(0x013978d0 + (i * 0x2A3);
if (str == str2)
{
return i;
}
}
return -1;
}
void MoveOverTime1(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime1();
*(int*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void MoveOverTime(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime();
*(short*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void FadeOverTime(int elemIndex, short Time, int R = 0, int G = 0, int B = 0, int A = 0)
{
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { R, G, B, A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void FadeGlowOverTimez(int elemIndex, short Time, int RG = 0, int GG = 0, int BG = 0, int A = 0)
{
*(int*)(elemIndex + Huds::glowColor) = *(int*)(elemIndex + Huds::glowColor);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { RG, GG, BG, A };
WriteBytes(elemIndex + Huds::glowColor, ColorArray, 4);
}
void MoveHudOverTime(int elemIndex, float X)
{
WriteFloat(elemIndex + Huds::X, X);
}
void FadeAlphaOverTime(int elemIndex, short Time, char A = 0)
{
char* readColorArray = ReadBytes(elemIndex + Huds::color, 3);
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { readColorArray[0], readColorArray[1], readColorArray[2], A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void ScaleOverTime(int elemIndex, short time, short width, short height)
{
*(short*)(elemIndex + Huds::fromHeight) = *(short*)(elemIndex + Huds::height);
*(short*)(elemIndex + Huds::fromWidth) = *(short*)(elemIndex + Huds::width);
*(int*)(elemIndex + Huds::scaleStartTime) = GetLevelTime();
*(short*)(elemIndex + Huds::scaleTime) = time;
*(short*)(elemIndex + Huds::width) = width;
*(short*)(elemIndex + Huds::height) = height;
}
void FontScaleOverTime(int elemIndex, float FontSize, short time)
{
/*(float*)(elemIndex + Huds::fromfrontscale) = *(float*)(elemIndex + Huds::fontscale);
*(int*)(elemIndex + Huds::fontscalestarttime) = GetLevelTime();
*(short*)(elemIndex + Huds::fontScaleTime) = time;
*(float*)(elemIndex + Huds::fontscale) = FontSize;*/
}
void ChangeText(int Element, char* text)
{
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
}
}
/*void doTypewriterText(int elemIndex, int clientIndex, const char * text, float x, float y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, color_s color, color_s glowColor)
{
int * levelTime = (int*)0x0012E0304;
int SetText(Elem, clientIndex, "", 4, 1.9f, x, y, 0x05, 0x91);
*(int*)(elemIndex + Huds::fxBirthTime) = *levelTime;
*(int*)(elemIndex + Huds::fxLetterTime) = fxLetterTime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(float*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
*(int*)(elemIndex + Huds::color) = color;
*(int*)(elemIndex + Huds::glowColor) = glowColor;
setFlagForeground(elem);
*(int*)(elemIndex + Huds::text) = G_LocalizedStringIndex(text);
}*/
//Menu Huds:
int Title[12];//12 = Number of clients
int Options[12];
int Background[12][2];//2 = 2 Background
int Scrollbar[12];
//Huds:
namespace Huds
{
enum Struct
{
X = 0x00,
Y = 0x04,
Z = 0x08,
fontscale = 0xC,
color = 0x10,
sort = 0x38,
glowColor = 0x3C,
targetEntNum = 0x70,
label = 0x48,
width = 0x4A,
height = 0x4C,
text = 0x56,
type = 0x64,
font = 0x65,
materialIndex = 0x68,
ui3dWindow = 0x6D,
fromColor = 20,
fadeStartTime = 24,
scaleStartTime = 28,
fromX = 32,
fromY = 36,
moveStartTime = 40,
time = 44,
duration = 48,
value = 52,
fxBirthTime = 64,
fromWidth = 78,
fromHeight = 80,
scaleTime = 82,
moveTime = 84,
fxLetterTime = 88,
fxDecayStartTime = 90,
fxDecayDuration = 92,
fxRedactDecayStartTime = 94,
fxRedactDecayDuration = 96,
flags = 98,
alignOrg = 102,
alignScreen = 103,
offscreenMaterialIdx = 105,
fromAlignOrg = 106,
fromAlignScreen = 107,
soundID = 108,
unknown = 110
};
namespace MenuIDs
{
int NewsBar[12];
int NewsbarUpLine[12];
int NewsbarBG[12];
int NewsbarUnLine[12];
int Scrollbar[12];
int Shader[12];
int Sidebar[12];
int Sidebar2[12];
int MenuTitle[12];
int OptionsText[12];
int MenuName[12];
int Creator[12];
char* MenuOptionText[12];
char* MenuTitleText[12];
char* CreatorText[12];
char* NewsBarText[12];
int PlayerVerification[12];
}
enum Verification
{
unverified,
verified,
vip,
host
};
void ChangeVerification(int clientIndex, Verification VerificationLevel)
{
MenuIDs:layerVerification[clientIndex] = (int)VerificationLevel;
}
enum TypewriterTextTypes
{
Normal = 0x800,//fix
Classic = 0x4000
};
int G_LocalizedStringIndex(char* txt)
{
opd_s GLS = { 0x00370638, TOC };
int(*GLSI)(char* txt) = (int(*)(char*))&GLS;
return GLSI(txt);
}
int GetLevelTime()
{
return *(int*)(Offsets::Level_Time);
}
int GetLevelTime1()
{
return *(int*)0x011E7889;
}
int HudElem_Alloc()
{
for (int client = 0; client < 12; client++)
{
for (int i = 150; i < 1024; i++)
{
unsigned int address = (0x11F26D4 + (client * 0x2A3 + (i * 0x7C));
char* Buffer = ReadBytes(address, 4);
if (Buffer[0] == 0x00)
{
*(int*)(address + Huds::type) = 0x7C;
return address;
}
}
}
return 1023;
}
int SetShader(int client, char Material, short Width, short Height, float x, float y, int r = 255, int g = 255, int b = 255, int a = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 8;
*(short*)(Element + Huds::height) = Height;
*(short*)(Element + Huds::width) = Width;
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(float*)(Element + Huds::sort) = 0;
*(int*)(Element + Huds::targetEntNum) = client;
*(char*)(Element + Huds::materialIndex) = Material;
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
int SetText(int client, char* text, float x, float y, int Allign, int AllignOrg, float fontsize, char font, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 255)
{
int Element = HudElem_Alloc();
*(char*)(Element + Huds::type) = 1;
*(int*)(Element + Huds::targetEntNum) = client;
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
*(int*)(Element + Huds::alignScreen) = Allign;
*(int*)(Element + Huds::alignOrg) = AllignOrg;
*(float*)(Element + Huds::fontscale) = fontsize;
*(char*)(Element + Huds::font) = font ;
*(char*)(Element + Huds::color) = r ;
*(char*)(Element + Huds::color + 0x01) = g ;
*(char*)(Element + Huds::color + 0x02) = b ;
*(char*)(Element + Huds::color + 0x03) = a;
*(char*)(Element + Huds::glowColor) = glowr;
*(char*)(Element + Huds::glowColor + 0x01) = glowg ;
*(char*)(Element + Huds::glowColor + 0x02) = glowb ;
*(char*)(Element + Huds::glowColor + 0x03) = glowa ;
*(char*)(Element + Huds::ui3dWindow) = 0xFF;
return Element;
}
void ChangeHUDColor(int Element, int r, int g, int b, int a)
{
*(char*)(Element + Huds::color) = r;
*(char*)(Element + Huds::color + 0x01) = g;
*(char*)(Element + Huds::color + 0x02) = b;
*(char*)(Element + Huds::color + 0x03) = a;
}
void ChangeMaterial(int Element, char Material)
{
*(char*)(Element + Huds::materialIndex) = Material;
}
void MoveShaderX(unsigned int Element, float x)
{
*(float*)(Element + Huds::X) = x;
}
void MoveShaderXY(unsigned int Element, float x, float y)
{
*(float*)(Element + Huds::X) = x;
*(float*)(Element + Huds::Y) = y;
}
int SetTypewriter(int clientIndex, char* Text, int Font, float FontSize, float X, float Y, int Type = Normal, short Lettertime = 200, short fxDecayStartTime = 7000, short fxDecayDuration = 1000, int r = 255, int g = 255, int b = 255, int a = 255, int glowr = 255, int glowg = 255, int glowb = 255, int glowa = 0)
{
int elemIndex = SetText(clientIndex, Text, X, Y, FontSize, Font, r, g, b, a, glowr, glowg, glowb, glowa);
*(int*)(elemIndex + Huds::flags) = Type;
*(int*)(elemIndex + Huds::fxBirthTime) = GetLevelTime();
*(short*)(elemIndex + Huds::fxLetterTime) = Lettertime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(short*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
return elemIndex;
}
void DestroyAllElems()
{
for (unsigned int i = 0; i < 1024; i++)
{
char input[0x7C];
WriteBytes(0x11F26D4 + (i * 0x7C), input, 0x7C);
}
}
int GetHost()
{
char* str = ReadString(0x02000934);
for (int i = 0; i < 12; i++)
{
char* str2 = ReadString(0x013978d0 + (i * 0x2A3);
if (str == str2)
{
return i;
}
}
return -1;
}
void MoveOverTime1(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime1();
*(int*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void MoveOverTime(unsigned int Elem, short time, float X, float Y)
{
*(float*)(Elem + Huds::fromX) = *(float*)(Elem);
*(float*)(Elem + Huds::fromY) = *(float*)(Elem + Huds::Y);
*(int*)(Elem + Huds::moveStartTime) = GetLevelTime();
*(short*)(Elem + Huds::moveTime) = time;
*(float*)Elem = X;
*(float*)(Elem + Huds::Y) = Y;
}
void FadeOverTime(int elemIndex, short Time, int R = 0, int G = 0, int B = 0, int A = 0)
{
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { R, G, B, A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void FadeGlowOverTimez(int elemIndex, short Time, int RG = 0, int GG = 0, int BG = 0, int A = 0)
{
*(int*)(elemIndex + Huds::glowColor) = *(int*)(elemIndex + Huds::glowColor);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { RG, GG, BG, A };
WriteBytes(elemIndex + Huds::glowColor, ColorArray, 4);
}
void MoveHudOverTime(int elemIndex, float X)
{
WriteFloat(elemIndex + Huds::X, X);
}
void FadeAlphaOverTime(int elemIndex, short Time, char A = 0)
{
char* readColorArray = ReadBytes(elemIndex + Huds::color, 3);
*(int*)(elemIndex + Huds::fromColor) = *(int*)(elemIndex + Huds::color);
*(int*)(elemIndex + Huds::fadeStartTime) = GetLevelTime();
//*(short*)(elemIndex + Huds::fadeTime) = Time;
char ColorArray[] = { readColorArray[0], readColorArray[1], readColorArray[2], A };
WriteBytes(elemIndex + Huds::color, ColorArray, 4);
}
void ScaleOverTime(int elemIndex, short time, short width, short height)
{
*(short*)(elemIndex + Huds::fromHeight) = *(short*)(elemIndex + Huds::height);
*(short*)(elemIndex + Huds::fromWidth) = *(short*)(elemIndex + Huds::width);
*(int*)(elemIndex + Huds::scaleStartTime) = GetLevelTime();
*(short*)(elemIndex + Huds::scaleTime) = time;
*(short*)(elemIndex + Huds::width) = width;
*(short*)(elemIndex + Huds::height) = height;
}
void FontScaleOverTime(int elemIndex, float FontSize, short time)
{
/*(float*)(elemIndex + Huds::fromfrontscale) = *(float*)(elemIndex + Huds::fontscale);
*(int*)(elemIndex + Huds::fontscalestarttime) = GetLevelTime();
*(short*)(elemIndex + Huds::fontScaleTime) = time;
*(float*)(elemIndex + Huds::fontscale) = FontSize;*/
}
void ChangeText(int Element, char* text)
{
*(int*)(Element + Huds::text - 2) = G_LocalizedStringIndex(text);
}
}
/*void doTypewriterText(int elemIndex, int clientIndex, const char * text, float x, float y, int fxLetterTime, int fxDecayStartTime, int fxDecayDuration, color_s color, color_s glowColor)
{
int * levelTime = (int*)0x0012E0304;
int SetText(Elem, clientIndex, "", 4, 1.9f, x, y, 0x05, 0x91);
*(int*)(elemIndex + Huds::fxBirthTime) = *levelTime;
*(int*)(elemIndex + Huds::fxLetterTime) = fxLetterTime;
*(short*)(elemIndex + Huds::fxDecayStartTime) = fxDecayStartTime;
*(float*)(elemIndex + Huds::fxDecayDuration) = fxDecayDuration;
*(int*)(elemIndex + Huds::color) = color;
*(int*)(elemIndex + Huds::glowColor) = glowColor;
setFlagForeground(elem);
*(int*)(elemIndex + Huds::text) = G_LocalizedStringIndex(text);
}*/
//Menu Huds:
int Title[12];//12 = Number of clients
int Options[12];
int Background[12][2];//2 = 2 Background
int Scrollbar[12];
Copyright © 2024, NextGenUpdate.
All Rights Reserved.