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-31-2015, 03:28 PM #11
Sticky
Mary J Wannnnna
Thanks
11-03-2015, 06:52 AM #12
Thanks for the Menu
11-03-2015, 04:06 PM #13
This is legit my labelling for Xbox, you guys had most things labelled unknown or wrong labels. Gj Swaqq you master leech you

EDIT:
www . se7en sins . com/forums/threads/community-code-list-any-language-advanced-warfare.1263343/page-13#post-10454706
Legit copy and paste, even the exact same comments. Once again, good job bro Facepalm
Last edited by Bitwise ; 11-03-2015 at 04:14 PM.
11-03-2015, 04:31 PM #14
Medaka
Save Point
Nig nog why are you still stealing code.
11-03-2015, 04:34 PM #15
Swaqq
Professional Thanker
Originally posted by Bitwise View Post
This is legit my labelling for Xbox, you guys had most things labelled unknown or wrong labels. Gj Swaqq you master leech you

EDIT:
www . se7en sins . com/forums/threads/community-code-list-any-language-advanced-warfare.1263343/page-13#post-10454706
Legit copy and paste, even the exact same comments. Once again, good job bro Facepalm


u say i am c/p? I made these huds from scratch. Justin just game me the struct. The rest is mine..
11-03-2015, 04:49 PM #16
Medaka
Save Point
Originally posted by Swaqq View Post
u say i am c/p? I made these huds from scratch. Justin just game me the struct. The rest is mine..


But you can't reverse? So how did you get it? If you're calling it yours just because you filled the targetEnt variable... wow
11-03-2015, 05:28 PM #17
Swaqq
Professional Thanker
Originally posted by Medaka View Post
But you can't reverse? So how did you get it? If you're calling it yours just because you filled the targetEnt variable... wow


What are you talking about? I can reverse LOL! I know ppc, I'm not the best but I can reverse and write functions. If you chose to think otherwise go ahead. I'm not concerned about your opinion.
11-03-2015, 05:40 PM #18
Originally posted by Swaqq View Post
u say i am c/p? I made these huds from scratch. Justin just game me the struct. The rest is mine..


Justin copy and pasted the structure from me, a simple google search proves it. I wasn't talking about the already-released functions, I was talking about the structure.

Originally posted by Medaka View Post
But you can't reverse? So how did you get it? If you're calling it yours just because you filled the targetEnt variable... wow


I labelled that, I'm sure I released the GSC function using it on the same account, I'll edit this if I find it on 7s.

EDIT:
That was fast, www . se7en sins . com/forums/threads/community-code-list-any-language-advanced-warfare.1263343/page-6 (user OPCode)

Note the structure in that post was prior to the update, but the labelling/research still counts aye.

Just want to add I don't care about the credits, but why take them?
Last edited by Bitwise ; 11-03-2015 at 05:53 PM.
11-03-2015, 06:04 PM #19
So he can get a little spot light

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo