Post: [SPRX] Hudelements (Real way of using Hud Elems)
07-28-2014, 06:21 AM #1
seb5594
Proud Former Admin
(adsbygoogle = window.adsbygoogle || []).push({}); Hey Guys,

Some of you might start to make a MW2 SPRX Menu, here's something which will help you to start. It's pretty easy to use and the best way also. It's similar how Xbox it does, i just made my own Functions out of it :p

You will need this structure at first
    struct opd_s{
uint32_t sub;
uint32_t toc;
};


Here are the Hud Elements with all required things :p

    
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type; // 0x00-0x04
float x; // 0x04-0x08
float y; // 0x08-0x0C
float z; // 0x0C-0x10
int targetEntNum; // 0x10-0x14
float fontScale; // 0x14-0x18
float fromFontScale; // 0x18-0x1C
int fontScaleStartTime; // 0x1C-0x20
int fontScaleTime; // 0x20-0x24
int label; // 0x24-0x28
int font; // 0x28-0x2C
int alignOrg; // 0x2C-0x30
int alignScreen; // 0x30-0x34
color_s color; // 0x34-0x38
color_s fromColor; // 0x38-0x3C
int fadeStartTime; // 0x3C-0x40
int fadeTime; // 0x40-0x44
int height; // 0x44-0x48
int width; // 0x48-0x4C
int materialIndex; // 0x4C-0x50
int fromHeight; // 0x50-0x54
int fromWidth; // 0x54-0x58
int scaleStartTime; // 0x58-0x5C
int scaleTime; // 0x5C-0x60
float fromY; // 0x60-0x64
float fromX; // 0x64-0x68
int fromAlignOrg; // 0x68-0x6C
int fromAlignScreen; // 0x6C-0x70
int moveStartTime; // 0x70-0x74
int moveTime; // 0x74-0x78
float value; // 0x78-0x7C
int time; // 0x7C-0x80
int duration; // 0x80-0x84
int text; // 0x84-0x88
float sort; // 0x88-0x8C
color_s glowColor; // 0x8C-0x90
int fxBirthTime; // 0x90-0x94
int fxLetterTime; // 0x94-0x98
int fxDecayStartTime; // 0x98-0x9C
int fxDecayDuration; // 0x9C-0xA0
int soundID; // 0xA0-0xA4
int flags; // 0xA4-0xA8
};
struct game_hudelem_s
{
hudelem_s elem;
long clientNum;
long team;
long archived;
};
int G_LocalizedStringIndex(const char* Text)
{
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))0x00708080;
return LocalizedStringIndex(Text);
}
opd_s HDA = { 0x001826B0, 0x00724C38 };
void(*HudElem_DestroyAll)() = (void(*)())&HDA;
opd_s GMI = { 0x001BE758, 0x00724C38 };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
opd_s HEA = { 0x001806E0, 0x00724C38 };
game_hudelem_s*(*HudElemAlloc)(int32_t client, int32_t teamNum) = (game_hudelem_s*(*)(int32_t, int32_t))&HEA;
game_hudelem_s* setShader(int clientIndex, const char* Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
*(int*)0x131689C = 1; //Allows to use precached Shaders
game_hudelem_s* elem = HudElemAlloc(clientIndex, 0);
elem->clientNum = clientIndex;
elem->elem.type = 6;
elem->elem.materialIndex = GetMaterialIndex(Shader);
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}
game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0,unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* elem = HudElemAlloc(clientIndex, 0);
elem->clientNum = clientIndex;
elem->elem.type = 1;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = Font;
elem->elem.fontScale = FontScale;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.alignScreen = 6;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
elem->elem.glowColor.r = glowR;
elem->elem.glowColor.g = glowG;
elem->elem.glowColor.b = glowB;
elem->elem.glowColor.a = glowA;
return elem;
}


Here is how you can spawn a elem
    
game_hudelem_s* MyElem = setText(0, "My sexy Text y0", 7, 2, 120, 220, 8, 255, 255, 255, 0, 0, 100, 255);
game_hudelem_s* MyShader = setShader(0, "white", 250, 100, 0, 0, 5, 255, 255, 255, 255);


Just set the Alpha to 0 if you want to hide anything :p

Credits:
Hacksource - Hudelem Structure
seb5594 - Building Functions
Therifboy - Way to call Functions using TOC
(adsbygoogle = window.adsbygoogle || []).push({});

The following 26 users say thank you to seb5594 for this useful post:

alex10998, AlexNGU, EdiTzZ, EnVatoHD, EternalHabit, FusionIsDaName, IRizerX, iTпDM, ItsLollo1000, KUSHxHERO, LaRip8, Loxy, M0T1VAT10N, John, OLDSCHOOLMODZHD, Script Kiddie, ShutTheCrunchUp, SnaY, Swaqq, Taylor, VezahMoDz, ViolentFelon, xPAQz, Yadderr, zMarcusHD
08-09-2014, 01:35 AM #11
SC58
Former Staff
Originally posted by SNIPER View Post
Thanks Seb
Anyone notice how seb said: It's similar how Xbox it does


lol it's the same gaming engine it will be done the same for all console that iw engine is on to a point and what i mean point is it may be codded different but at the end of the day everything done on one console can be done on the other lol

The following user thanked SC58 for this useful post:

ShutTheCrunchUp
08-09-2014, 02:00 AM #12
ShutTheCrunchUp
Climbing up the ladder
Thanks for the great post seb! <3 Happy
08-09-2014, 03:13 AM #13
Zambie
< ^ > < ^ >
Originally posted by SC58 View Post
lol it's the same gaming engine it will be done the same for all console that iw engine is on to a point and what i mean point is it may be codded different but at the end of the day everything done on one console can be done on the other lol


i meant as he says how xbox it does, it's supposed to be How xbox does it
08-09-2014, 04:31 PM #14
Swaqq
Professional Thanker
Why am I getting UNLOCALIZED(<text i input>Winky Winky?
08-09-2014, 06:38 PM #15
Originally posted by NGU View Post
Why am I getting UNLOCALIZED(<text i input>Winky Winky?

You need something like this:
Player::SetClientDvars(Client, "loc_warnings 0");
Player::SetClientDvars(Client, "loc_warningsAsErrors 0");
08-16-2014, 04:31 AM #16
Shark
Retired.
Originally posted by seb5594 View Post
Hey Guys,

Some of you might start to make a MW2 SPRX Menu, here's something which will help you to start. It's pretty easy to use and the best way also. It's similar how Xbox it does, i just made my own Functions out of it :p

You will need this structure at first
    struct opd_s{
uint32_t sub;
uint32_t toc;
};


Here are the Hud Elements with all required things :p

    
union color_s
{
struct
{
int8_t r;
int8_t g;
int8_t b;
int8_t a;
};
int32_t rgba;
};
struct hudelem_s
{
int type; // 0x00-0x04
float x; // 0x04-0x08
float y; // 0x08-0x0C
float z; // 0x0C-0x10
int targetEntNum; // 0x10-0x14
float fontScale; // 0x14-0x18
float fromFontScale; // 0x18-0x1C
int fontScaleStartTime; // 0x1C-0x20
int fontScaleTime; // 0x20-0x24
int label; // 0x24-0x28
int font; // 0x28-0x2C
int alignOrg; // 0x2C-0x30
int alignScreen; // 0x30-0x34
color_s color; // 0x34-0x38
color_s fromColor; // 0x38-0x3C
int fadeStartTime; // 0x3C-0x40
int fadeTime; // 0x40-0x44
int height; // 0x44-0x48
int width; // 0x48-0x4C
int materialIndex; // 0x4C-0x50
int fromHeight; // 0x50-0x54
int fromWidth; // 0x54-0x58
int scaleStartTime; // 0x58-0x5C
int scaleTime; // 0x5C-0x60
float fromY; // 0x60-0x64
float fromX; // 0x64-0x68
int fromAlignOrg; // 0x68-0x6C
int fromAlignScreen; // 0x6C-0x70
int moveStartTime; // 0x70-0x74
int moveTime; // 0x74-0x78
float value; // 0x78-0x7C
int time; // 0x7C-0x80
int duration; // 0x80-0x84
int text; // 0x84-0x88
float sort; // 0x88-0x8C
color_s glowColor; // 0x8C-0x90
int fxBirthTime; // 0x90-0x94
int fxLetterTime; // 0x94-0x98
int fxDecayStartTime; // 0x98-0x9C
int fxDecayDuration; // 0x9C-0xA0
int soundID; // 0xA0-0xA4
int flags; // 0xA4-0xA8
};
struct game_hudelem_s
{
hudelem_s elem;
long clientNum;
long team;
long archived;
};
int G_LocalizedStringIndex(const char* Text)
{
int(*LocalizedStringIndex)(const char* Text) = (int(*)(const char*))0x00708080;
return LocalizedStringIndex(Text);
}
opd_s HDA = { 0x001826B0, 0x00724C38 };
void(*HudElem_DestroyAll)() = (void(*)())&HDA;
opd_s GMI = { 0x001BE758, 0x00724C38 };
int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
opd_s HEA = { 0x001806E0, 0x00724C38 };
game_hudelem_s*(*HudElemAlloc)(int32_t client, int32_t teamNum) = (game_hudelem_s*(*)(int32_t, int32_t))&HEA;
game_hudelem_s* setShader(int clientIndex, const char* Shader, int Width, int Height, float X, float Y, int Allign = 5, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0)
{
*(int*)0x131689C = 1; //Allows to use precached Shaders
game_hudelem_s* elem = HudElemAlloc(clientIndex, 0);
elem->clientNum = clientIndex;
elem->elem.type = 6;
elem->elem.materialIndex = GetMaterialIndex(Shader);
elem->elem.width = Width;
elem->elem.height = Height;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
return elem;
}
game_hudelem_s* setText(int clientIndex, const char* Text, int Font, float FontScale, float X, float Y, int Allign, unsigned char R = 0, unsigned char G = 0, unsigned char B = 0, unsigned char A = 0,unsigned char glowR = 0, unsigned char glowG = 0, unsigned char glowB = 0, unsigned char glowA = 0)
{
game_hudelem_s* elem = HudElemAlloc(clientIndex, 0);
elem->clientNum = clientIndex;
elem->elem.type = 1;
elem->elem.text = G_LocalizedStringIndex(Text);
elem->elem.font = Font;
elem->elem.fontScale = FontScale;
elem->elem.x = X;
elem->elem.y = Y;
elem->elem.alignOrg = Allign;
elem->elem.alignScreen = 6;
elem->elem.color.r = R;
elem->elem.color.g = G;
elem->elem.color.b = B;
elem->elem.color.a = A;
elem->elem.glowColor.r = glowR;
elem->elem.glowColor.g = glowG;
elem->elem.glowColor.b = glowB;
elem->elem.glowColor.a = glowA;
return elem;
}


Here is how you can spawn a elem
    
game_hudelem_s* MyElem = setText(0, "My sexy Text y0", 7, 2, 120, 220, 8, 255, 255, 255, 0, 0, 100, 255);
game_hudelem_s* MyShader = setShader(0, "white", 250, 100, 0, 0, 5, 255, 255, 255, 255);


Just set the Alpha to 0 if you want to hide anything :p

Credits:
Hacksource - Hudelem Structure
seb5594 - Building Functions
Therifboy - Way to call Functions using TOC


how the fuck do u get g_localizedstringindex working on this fucking game :yuno:
08-18-2014, 12:39 AM #17
Nice Thread Seb :yes: but the x and y are switched and the alignment is wrong
08-18-2014, 07:39 PM #18
is it possible for you guys to make the EBOOT CEX compatible as well? i am on DEX but when i try signing in on DEX i get a DNS error so a CEX EBOOT to exc the sprx menus would be great Smile
08-19-2014, 12:09 AM #19
SC58
Former Staff
Originally posted by xRevolveMods View Post
is it possible for you guys to make the EBOOT CEX compatible as well? i am on DEX but when i try signing in on DEX i get a DNS error so a CEX EBOOT to exc the sprx menus would be great Smile


learn to decrypt and resign EBOOT.BIN or xxx.self it's not hard no need to be lazy and wait for someone else to do it i mean you have a jb ps3 atleast use it lol

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo