#pragma region Hud Elements
struct color_t
{
char r;
char g;
char b;
char a;
};
union hudelem_color_t
{
color_t color;
int rgba;
};
struct hudelem_s
{
float x;//0x00
float y;//0x04
float z;//0x08;
float fontScale;//0xC
float fromFontScale;//0x10
int fontScaleStartTime;//0x14
hudelem_color_t color;//0x18
hudelem_color_t fromColor;//0x1C
int fadeStartTime;//0x20
int scaleStartTime;//0x24
float fromX;//0x28
float fromY;//0x2C
int moveStartTime;//0x30
int time;//0x34
int duration;//0x38
float value;//0x3C
float sort;//0x40
hudelem_color_t glowColor;//0x44
int fxBirthTime;//0x48
int flags;//0x4C
short targetEntNum;//0x50
short fontScaleTime;//0x52
short fadeTime;//0x54
short label;//0x56
short width;//0x58
short height; //0x5A
short fromWidth;//0x5C
short fromHeight;//0x5E
short scaleTime;//0x60
short moveTime;//0x62
short text;//0x64
short fxLetterTime;//0x66
short fxDecayStartTime;//0x68
short fxDecayDuration;//0x6A
short fxRedactDecayStartTime;//0x6C
short fxRedactDecayDuration;//0x6E
unsigned char type;//0x70
unsigned char font;//0x71
unsigned char alignOrg;//0x72
unsigned char alignScreen;//0x73
short materialIndex;//0x74
short offscreenMaterialIndex;//0x76
unsigned char fromAlignOrg;//0x78
unsigned char fromAlignScreen;//0x79
unsigned char soundID;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C
int team;//0x80
int abilityFlag;//0x84
};
game_hudelem_s* HudElem_Alloc()
{
for (int i = 120; i < 1024; i++)
{
game_hudelem_s* elem = (game_hudelem_s*)(0x176F348 + (i * 0x8);
if (elem->elem.type == 0)
{
printf("\nHud: %i\n", i);
return elem;
}
}
return (game_hudelem_s*)0;
}
#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388C14))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388CF)(Text)
int GetLevelTime(){
return *(int*)(0x1780B00 + 0x98C);//BO3 1.01
}
void ChangeText(game_hudelem_s* elem, const char* text){
elem->elem.text = G_LocalizedStringIndex(text);
}
game_hudelem_s* SetShader(int client, const char* shader, float x, float y, short width, short height, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 8;
elem->elem.materialIndex = G_MaterialIndex(shader);
elem->elem.width = width;
elem->elem.height = height;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.alignOrg = 0;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}
game_hudelem_s* SetText(int client, const char* Text, int font, float fontSize, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = 1;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = font;
elem->elem.fontScale = fontSize;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}
void fadeOverTime(game_hudelem_s * Elem, int Time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.color.r = R;
Elem->elem.color.color.g = G;
Elem->elem.color.color.b = B;
Elem->elem.color.color.a = A;
Elem->elem.fadeTime = Time;
Elem->elem.fadeStartTime = GetLevelTime();
}
void moveOverTime(game_hudelem_s * elem, int time, float X, float Y)
{
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.moveStartTime = GetLevelTime();
elem->elem.moveTime = time;
elem->elem.x = X;
elem->elem.y = Y;
}
void scaleOverTime(game_hudelem_s* elem, int time, short width, short height){
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.scaleStartTime = GetLevelTime();
elem->elem.scaleTime = time;
elem->elem.width = width;
elem->elem.height = height;
}
#pragma endregion
Sabotage & John - Some addresses
typedef struct _hudelem_s
{
float x;
float y;
float z;
float fontScale;
float fromFontScale;
int fontScaleStartTime;
hudelem_color_s color;
hudelem_color_s fromColor;
int fadeStartTime;
int scaleStartTime;
float fromX;
float fromY;
int moveStartTime;
int time;
int duration;
float value;
float sort;
hudelem_color_s glowColor;
int fxBirthTime;
int flags;
short targetEntNum;
short fontScaleTime;
short fadeTime;
short label;
short width;
short height;
short fromWidth;
short fromHeight;
short scaleTime;
short moveTime;
short text;
short fxLetterTime;
short fxDecayStartTime;
short fxDecayDuration;
short fxRedactDecayStartTime;
short fxRedactDecayDuration;
unsigned char type;
unsigned char font;
unsigned char alignOrg;
unsigned char alignScreen;
short materialIndex;
short offscreenMaterialIdx;
unsigned char fromAlignOrg;
unsigned char fromAlignScreen;
unsigned char soundID;
};
#pragma region Hud Elements
struct color_t
{
char r;
char g;
char b;
char a;
};
union hudelem_color_t
{
color_t color;
int rgba;
};
enum he_type_t
{
HE_TYPE_NONE,
HE_TYPE_TEXT,
HE_TYPE_VALUE,
HE_TYPE_PLAYERNAME,
HE_TYPE_MATERIAL,
HE_TYPE_TIMER_UP,
HE_TYPE_TIMER_DOWN,
HE_TYPE_TIMER_STATIC,
HE_TYPE_TIMER_TENTHS_UP,
HE_TYPE_TIMER_TENTHS_DOWN,
HE_TYPE_TIMER_TENTHS_STATIC,
HE_TYPE_CLOCK_UP,
HE_TYPE_CLOCK_DOWN,
HE_TYPE_WAYPOINT,
HE_TYPE_UNKNOWN1,
HE_TYPE_UNKNOWN2,
HE_TYPE_UNKNOWN3,
HE_TYPE_MOVER,
};
struct hudelem_s
{
float x;//0x00
float y;//0x04
float z;//0x08;
float fontScale;//0xC
float fromFontScale;//0x10
int fontScaleStartTime;//0x14
hudelem_color_t color;//0x18
hudelem_color_t fromColor;//0x1C
int fadeStartTime;//0x20
int scaleStartTime;//0x24
float fromX;//0x28
float fromY;//0x2C
int moveStartTime;//0x30
int time;//0x34
int duration;//0x38
float value;//0x3C
float sort;//0x40
hudelem_color_t glowColor;//0x44
int fxBirthTime;//0x48
int flags;//0x4C
short targetEntNum;//0x50
short fontScaleTime;//0x52
short fadeTime;//0x54
short label;//0x56
short width;//0x58
short height; //0x5A
short fromWidth;//0x5C
short fromHeight;//0x5E
short scaleTime;//0x60
short moveTime;//0x62
short text;//0x64
short fxLetterTime;//0x66
short fxDecayStartTime;//0x68
short fxDecayDuration;//0x6A
short fxRedactDecayStartTime;//0x6C
short fxRedactDecayDuration;//0x6E
unsigned char type;//0x70
unsigned char font;//0x71
unsigned char alignOrg;//0x72
unsigned char alignScreen;//0x73
unsigned char materialIndex;//0x74
unsigned char offscreenMaterialIndex;//0x75
unsigned char fromAlignOrg;//0x76
unsigned char fromAlignScreen;//0x77
unsigned char soundID;//0x78
unsigned char ui3dWindow;//0x79;
short flag2;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;//0x00 - 0x7B
int clientNum;//0x7C
int team;//0x80
int abilityFlag;//0x84
};
opd_s ha = { 0x32D3C4, TOC }; //Wrong... Use the HudElem_Alloc function.
game_hudelem_s*(*HudElem_Alloc)(int client, int team) = (game_hudelem_s*(*)(int, int))&ha;
#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388C14))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x00388CF)(Text)
int GetLevelTime(){
return *(int*)(0x1780B00 + 0x98C);//BO3 1.01
}
void ChangeText(game_hudelem_s* elem, const char* text){
elem->elem.text = G_LocalizedStringIndex(text);
}
game_hudelem_s* SetShader(int client, const char* shader, float x, float y, short width, short height, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = HE_TYPE_MATERIAL;
elem->elem.materialIndex = G_MaterialIndex(shader);
elem->elem.width = width;
elem->elem.height = height;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.alignOrg = 0;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}
game_hudelem_s* SetText(int client, const char* Text, int font, float fontSize, float x, float y, unsigned char r, unsigned char g, unsigned char b, unsigned char a){
game_hudelem_s* elem = HudElem_Alloc(client, 0);
elem->clientNum = client;
elem->elem.type = HE_TYPE_TEXT;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = font;
elem->elem.fontScale = fontSize;
elem->elem.x = x;
elem->elem.y = y;
elem->elem.color.color.r = r;
elem->elem.color.color.g = g;
elem->elem.color.color.b = b;
elem->elem.color.color.a = a;
elem->elem.ui3dWindow = 0xFF;
return elem;
}
void fadeOverTime(game_hudelem_s * Elem, int Time, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
Elem->elem.fromColor = Elem->elem.color;
Elem->elem.color.color.r = R;
Elem->elem.color.color.g = G;
Elem->elem.color.color.b = B;
Elem->elem.color.color.a = A;
Elem->elem.fadeTime = Time;
Elem->elem.fadeStartTime = GetLevelTime();
}
void moveOverTime(game_hudelem_s * elem, int time, float X, float Y)
{
elem->elem.fromX = elem->elem.x;
elem->elem.fromY = elem->elem.y;
elem->elem.moveStartTime = GetLevelTime();
elem->elem.moveTime = time;
elem->elem.x = X;
elem->elem.y = Y;
}
void scaleOverTime(game_hudelem_s* elem, int time, short width, short height){
elem->elem.fromWidth = elem->elem.width;
elem->elem.fromHeight = elem->elem.height;
elem->elem.scaleStartTime = GetLevelTime();
elem->elem.scaleTime = time;
elem->elem.width = width;
elem->elem.height = height;
}
#pragma endregion
Sabotage & John - Some addresses
Copyright © 2024, NextGenUpdate.
All Rights Reserved.