Post: [RELEASE][1.20] C++ Hud Elements
10-29-2015, 08:43 PM #1
Swaqq
Professional Thanker
(adsbygoogle = window.adsbygoogle || []).push({}); Hello everyone, I was planning to release these for a while now, but wanted to release my menu first. Since I won't be finishing it, here are the hud elements. They work for all clients, and aren't buggy.
Here is an example of the hud elems:
You must login or register to view this content.

    
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,
};
typedef struct hudelem_s
{
short targetEntNum;//0x0
short targetEntNum1;//0x2
unsigned char font;//0x4
unsigned char alignOrg;//0x5
unsigned char alignScreen;//0x6
unsigned char type;//0x7
float x;//0x8
float y;//0xC
float z;//0x10
float fontScale;//0x14
float fromFontScale;//0x18
int fontScaleStartTime;//0x1C
int fontScaleTime;//0x20
hudelem_color_t color;//0x24
hudelem_color_t fromColor;//0x28
int fadeStartTime;//0x2C
int fadeTime;//0x30
short label;//0x34
short width;//0x36
short height;//0x38
short materialIndex;//0x3A
short fromWidth;//0x3C
short fromHeight;//0x3E
float fromX;//0x40
float fromY;//0x44
unsigned char fromAlignOrg;//0x48
unsigned char fromAlignScreen;//0x49
char pad[2];//0x4A
int moveStartTime;//0x4C
int scaleStartTime;//0x50
short scaleTime;//0x54;
short moveTime;//0x56
int time;//0x58
int duration;//0x5C
float value;//0x60
float sort;//0x64
short text;//0x68
unsigned char soundID;//0x6A
unsigned char targetEntBoneId;//0x6B;
int flags;//0x6C
hudelem_color_t glowColor;//0x70
short fxBirthTime;//0x74
short fxLetterTime;//0x76
short fxDecayStartTime;//0x78
short fxDecayDuration;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;
int clientNum;//0x7C
int teamNum;//0x80
int archived;//0x84
int showInKillcam;//0x88-0x8C
};

opd_s ha = { 0x32D3C4, TOC };
game_hudelem_s*(*HudElem_Alloc)(int client, int team) = (game_hudelem_s*(*)(int, int))&ha;

#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x54A90))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x4E650))(Text)

int GetLevelTime(){
return *(int*)(0x1985D00 + 0x4C0);
}
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->elem.targetEntNum = 0x5FF;
elem->elem.targetEntNum1 = 0x5FF;
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;
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->elem.targetEntNum = 0x5FF;
elem->elem.targetEntNum1 = 0x5FF;
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;
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;
}

All these addresses are for 1.20.

Here is an example of how to use the huds:
    
game_hudelem_s* Shader = SetShader(client, "white", 200, 0, 250, 1000, 0, 0, 0, 160);
game_hudelem_s* Text = SetText(client, "example text", 3, 1.5, 210, 100, 255, 255, 255, 255);


Have fun modding Advanced Warfare.
Hopefully, we can get some menus out of this, if not, I'll release my base.

    
Justin/Shark - Hud Struct
Me - Creating the Huds


-Swaqq

The following 9 users say thank you to Swaqq for this useful post:

Sabotage, gοd, LcGamingHD, John, ParadoxSPRX, RoRoH_AR, basshead4ever, zAlbanianModder
11-05-2015, 02:25 PM #20
Medaka
Save Point
Originally posted by Swaqq View Post
I can reverse LOL! I know ppc

The following user thanked Medaka for this useful post:

Bitwise
12-25-2015, 08:49 PM #21
gοd
Vault dweller
Thanks Swaqq Hopefully this will bring some life back to AW and hopefully some great sprx menus get released What :isee: Geo
12-28-2015, 09:44 PM #22
TrillBrown
< ^ > < ^ >
Originally posted by Swaqq View Post
Hello everyone, I was planning to release these for a while now, but wanted to release my menu first. Since I won't be finishing it, here are the hud elements. They work for all clients, and aren't buggy.
Here is an example of the hud elems:
You must login or register to view this content.

    
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,
};
typedef struct hudelem_s
{
short targetEntNum;//0x0
short targetEntNum1;//0x2
unsigned char font;//0x4
unsigned char alignOrg;//0x5
unsigned char alignScreen;//0x6
unsigned char type;//0x7
float x;//0x8
float y;//0xC
float z;//0x10
float fontScale;//0x14
float fromFontScale;//0x18
int fontScaleStartTime;//0x1C
int fontScaleTime;//0x20
hudelem_color_t color;//0x24
hudelem_color_t fromColor;//0x28
int fadeStartTime;//0x2C
int fadeTime;//0x30
short label;//0x34
short width;//0x36
short height;//0x38
short materialIndex;//0x3A
short fromWidth;//0x3C
short fromHeight;//0x3E
float fromX;//0x40
float fromY;//0x44
unsigned char fromAlignOrg;//0x48
unsigned char fromAlignScreen;//0x49
char pad[2];//0x4A
int moveStartTime;//0x4C
int scaleStartTime;//0x50
short scaleTime;//0x54;
short moveTime;//0x56
int time;//0x58
int duration;//0x5C
float value;//0x60
float sort;//0x64
short text;//0x68
unsigned char soundID;//0x6A
unsigned char targetEntBoneId;//0x6B;
int flags;//0x6C
hudelem_color_t glowColor;//0x70
short fxBirthTime;//0x74
short fxLetterTime;//0x76
short fxDecayStartTime;//0x78
short fxDecayDuration;//0x7A
};
typedef struct game_hudelem_s
{
hudelem_s elem;
int clientNum;//0x7C
int teamNum;//0x80
int archived;//0x84
int showInKillcam;//0x88-0x8C
};

opd_s ha = { 0x32D3C4, TOC };
game_hudelem_s*(*HudElem_Alloc)(int client, int team) = (game_hudelem_s*(*)(int, int))&ha;

#define G_LocalizedStringIndex(Text) ((int(*)(const char*))&ParseAddr(0x54A90))(Text)
#define G_MaterialIndex(Text) ((int(*)(const char*))&ParseAddr(0x4E650))(Text)

int GetLevelTime(){
return *(int*)(0x1985D00 + 0x4C0);
}
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->elem.targetEntNum = 0x5FF;
elem->elem.targetEntNum1 = 0x5FF;
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;
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->elem.targetEntNum = 0x5FF;
elem->elem.targetEntNum1 = 0x5FF;
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;
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;
}

All these addresses are for 1.20.

Here is an example of how to use the huds:
    
game_hudelem_s* Shader = SetShader(client, "white", 200, 0, 250, 1000, 0, 0, 0, 160);
game_hudelem_s* Text = SetText(client, "example text", 3, 1.5, 210, 100, 255, 255, 255, 255);


Have fun modding Advanced Warfare.
Hopefully, we can get some menus out of this, if not, I'll release my base.

    
Justin/Shark - Hud Struct
Me - Creating the Huds


-Swaqq


Swaqq can update your tool for Aw plz I will donate ........
12-29-2015, 07:33 AM #23
Devilemi
Can’t trickshot me!
noice but not everyone known how to do it i will work with this but the community cant release a lot of stuff ResistTheSun JS

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo