Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cellstatus.h>
- #include <sys/prx.h>
- #define TOC 0xA7F3C8
- struct opd_s
- {
- uint32_t sub;
- uint32_t toc;
- };
- union color_s
- {
- struct
- {
- int8_t r;
- int8_t g;
- int8_t b;
- int8_t a;
- };
- int32_t 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;
- int 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;
- };
- opd_s GLS = { 0x34348, TOC };
- int(*G_LocalizedStringIndex)(const char* String) = (int(*)(const char*))&GLS;
- opd_s GMI = { 0x0032334, TOC };
- int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
- game_hudelem_s* HudElem_Alloc()
- {
- for (int i = 0; i < 1024; i++)
- {
- game_hudelem_s* elem = (game_hudelem_s*)(0xD87C88 + (i * 0xB4));
- if (!elem->elem.type) return elem;
- }
- return (game_hudelem_s*)-1;
- }
- game_hudelem_s* setShader(int clientIndex, int Material, 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)
- {
- game_hudelem_s* elem = HudElem_Alloc();
- elem->clientNum = clientIndex;
- elem->elem.type = 4;
- *(int*)0x00F3B198 = 5594;
- elem->elem.materialIndex = Material;
- *(int*)0x00F3B198 = 0;
- 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 = HudElem_Alloc();
- 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 = 0;
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement