Post: Hud Elements PC Fix C++
08-05-2019, 03:39 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So i've been working a bit on some cod ghosts pc stuff and shaders work just fine but the text does not seem to work, I know this happens on console aswell but have no idea I have to do to make it work. Would appreciate the help Awesome face
    union color_s

{

struct

{

char r, g, b, a;

};

unsigned int rgba;

};

struct hudelem_s

{

int type;

float x;

float y;

float z;

int targetEntNum;

float fontScale;

float fromFontScale;

float fontScaleStartTime;

float fontScaleTime;

int font;

int alignOrg;

int alignScreen;

color_s color;

color_s fromColor;

int fadeStartTime;

int fadeTime;

int label;

int width;

int height;

int materialIndex;

int fromWidth;

int fromHeight;

int scaleStartTime;

int scaleTime;

float fromX;

float fromY;

int fromAlignOrg;

int fromAlignScreen;

int moveStartTime;

int moveTime;

int time;

int duration;

float value;

short text;

float sort;

color_s glowColor;

int fxBirthTime;

int fxLetterTime;

int fxDecayStartTime;

int fxDecayDuration;

int soundID;

int flags;

};

struct game_hudelem_s

{

hudelem_s elem;

int clientNum;

int team;

int archived;

int currentShowInKillcam;

};

#define G_LSI 0x140163CA0
short G_LocalizedStringIndex(const char *text)
{
return RPC<short>(G_LSI, text);
}

int G_MaterialIndex(const char *Shader)
{
return RPC<int>(0x140162320, Shader);
}

int G_Time()
{
return *(int*)0x1443F4B6C;
}

game_hudelem_s * HudElem_Alloc()
{
for (int i = 124; i < 1024; i++)
{
game_hudelem_s* Alloc = (game_hudelem_s*)(0x14424C0B0 + (i * sizeof(game_hudelem_s)));
if (Alloc->elem.type == 0)
return Alloc;
if (i >= 0x3FF)
break;
}
return 0;
}



game_hudelem_s * AddText(int Player, char * Text, char Font, float FontSize, float X, float Y, char R, char G, char B, char A, char GR, char GG, char GB, char GA)
{
game_hudelem_s * Elem = HudElem_Alloc();
Elem->clientNum = Player;
Elem->team = 0;
Elem->elem.type = 1;
Elem->elem.font = Font;
Elem->elem.alignOrg = 0;
Elem->elem.alignScreen = 0;
Elem->elem.fontScale = FontSize;
Elem->elem.x = X;
Elem->elem.y = Y;
Elem->elem.flags |= 1u;
Elem->elem.text = G_LocalizedStringIndex(Text);
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
Elem->elem.glowColor.r = GR;
Elem->elem.glowColor.g = GG;
Elem->elem.glowColor.b = GB;
Elem->elem.glowColor.a = GA;
return Elem;
}

game_hudelem_s * AddShader(int Player, const char * Material, int Width, int Height, float X, float Y, char R, char G, char B, char A)
{
game_hudelem_s * Elem = HudElem_Alloc();
Elem->clientNum = Player;
Elem->team = 0;
Elem->elem.type = 4;
Elem->elem.width = Width;
Elem->elem.height = Height;
Elem->elem.x = X;
Elem->elem.y = Y;
Elem->elem.sort = 0;
Elem->elem.materialIndex = G_MaterialIndex(Material);
Elem->elem.color.r = R;
Elem->elem.color.g = G;
Elem->elem.color.b = B;
Elem->elem.color.a = A;
return Elem;
}
Last edited by xCometMods ; 08-05-2019 at 03:41 PM.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo