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
10-29-2015, 08:49 PM #2
Famous_Editionz
Bounty hunter
GreatJob!!! :yes:

The following user thanked Famous_Editionz for this useful post:

Swaqq
10-29-2015, 09:44 PM #3
Thanks! I never knew how to find this!

The following 2 users say thank you to John for this useful post:

Sabotage, Swaqq
10-29-2015, 09:50 PM #4
SC58
Former Staff
Originally posted by John View Post
Thanks! I never knew how to find this!


you can map it out in memory or map it out in the hudelem functions in ida, i think doing it all in ida is more easyier imo :p
10-29-2015, 11:17 PM #5
Good work Smile
10-30-2015, 01:02 AM #6
FFM | iMoDzRGFR
Are you high?
If u want i have converted a little on c# :P

    public static class GlobalMembers
{
public delegate game_hudelem_s HudElem_AllocDelegate(int client, int team);
public static HudElem_AllocDelegate HudElem_Alloc;

public static int GetLevelTime()
{
return (int)(0x1985D00 + 0x4C0);
}
}

public class color_t
{
public sbyte r;
public sbyte g;
public sbyte b;
public sbyte a;
}

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

private game_hudelem_s SetShader(int client, string shader, float x, float y, short width, short height, byte r, byte g, byte b, byte 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 = (short)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;
}


private game_hudelem_s SetText(int client, string Text, int font, float fontSize, float x, float y, byte r, byte g, byte b, byte 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 = (short)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;
}

private void fadeOverTime(game_hudelem_s Elem, int Time, byte R = 0, byte G = 0, byte B = 0, byte 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();
}


private 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;
}
private 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;
}

int GetLevelTime()
{
return (int)(0x1985D00 + 0x4C0);
}

public int g_materialindex(string Text)
{
return 0x4E650;
}
public int g_localizedstringindex(string Text)
{
return 0x54A90;
}
10-30-2015, 04:39 PM #7
Nice work Happy
10-31-2015, 09:58 AM #8
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


Release the menu bro Smile
10-31-2015, 02:08 PM #9
Sticky
Mary J Wannnnna
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


What is the TOC address?
10-31-2015, 03:09 PM #10
Swaqq
Professional Thanker
Originally posted by sticky View Post
what is the toc address?


0x9d5530

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo