Advertisement
ThePJ120

Ghost 1.16 Huds SPRX

Feb 20th, 2015
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.31 KB | None | 0 0
  1. #include <cellstatus.h>
  2. #include <sys/prx.h>
  3.  
  4. #define TOC 0xA7F3C8
  5.  
  6. struct opd_s
  7. {
  8.     uint32_t sub;
  9.     uint32_t toc;
  10. };
  11.  
  12. union color_s
  13. {
  14.     struct
  15.     {
  16.         int8_t r;            
  17.         int8_t g;            
  18.         int8_t b;      
  19.         int8_t a;  
  20.     };
  21.     int32_t rgba;
  22. };
  23.  
  24. struct hudelem_s
  25. {
  26.     int type;
  27.     float x;
  28.     float y;
  29.     float z;
  30.     int targetEntNum;
  31.     float fontScale;
  32.     float fromFontScale;
  33.     float fontScaleStartTime;
  34.     float fontScaleTime;
  35.     int font;
  36.     int alignOrg;
  37.     int alignScreen;
  38.     color_s color;
  39.     color_s fromColor;
  40.     int fadeStartTime;
  41.     int fadeTime;
  42.     int label;
  43.     int width;
  44.     int height;
  45.     int materialIndex;
  46.     int fromWidth;
  47.     int fromHeight;
  48.     int scaleStartTime;
  49.     int scaleTime;
  50.     float fromX;
  51.     float fromY;
  52.     int fromAlignOrg;
  53.     int fromAlignScreen;
  54.     int moveStartTime;
  55.     int moveTime;
  56.     int time;
  57.     int duration;
  58.     float value;
  59.     int text;
  60.     float sort;
  61.     color_s glowColor;
  62.     int fxBirthTime;
  63.     int fxLetterTime;
  64.     int fxDecayStartTime;
  65.     int fxDecayDuration;
  66.     int soundID;
  67.     int flags;
  68. };
  69.  
  70. struct game_hudelem_s
  71. {
  72.     hudelem_s elem;
  73.     int clientNum;
  74.     int team;
  75.     int archived;
  76. };
  77.  
  78. opd_s GLS = { 0x34348, TOC };
  79. int(*G_LocalizedStringIndex)(const char* String) = (int(*)(const char*))&GLS;
  80.  
  81. opd_s GMI = { 0x0032334, TOC };
  82. int(*GetMaterialIndex)(const char* Material) = (int(*)(const char*))&GMI;
  83.  
  84. game_hudelem_s* HudElem_Alloc()
  85. {
  86.     for (int i = 0; i < 1024; i++)
  87.     {
  88.         game_hudelem_s* elem = (game_hudelem_s*)(0xD87C88 + (i * 0xB4));
  89.         if (!elem->elem.type) return elem;
  90.     }
  91.     return (game_hudelem_s*)-1;
  92. }
  93.  
  94. 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)
  95. {
  96.     game_hudelem_s* elem = HudElem_Alloc();
  97.     elem->clientNum = clientIndex;
  98.     elem->elem.type = 4;
  99.     *(int*)0x00F3B198 = 5594;
  100.     elem->elem.materialIndex = Material;
  101.     *(int*)0x00F3B198 = 0;
  102.     elem->elem.width = Width;
  103.     elem->elem.height = Height;
  104.     elem->elem.x = X;
  105.     elem->elem.y = Y;
  106.     elem->elem.alignOrg = Allign;
  107.     elem->elem.color.r = R;
  108.     elem->elem.color.g = G;
  109.     elem->elem.color.b = B;
  110.     elem->elem.color.a = A;
  111.     return elem;
  112. }
  113. 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)
  114. {
  115.     game_hudelem_s* elem = HudElem_Alloc();
  116.     elem->clientNum = clientIndex;
  117.     elem->elem.type = 1;
  118.     elem->elem.text = G_LocalizedStringIndex(Text);
  119.     elem->elem.font = Font;
  120.     elem->elem.fontScale = FontScale;
  121.     elem->elem.x = X;
  122.     elem->elem.y = Y;
  123.     elem->elem.alignOrg = Allign;
  124.     elem->elem.alignScreen = 0;
  125.     elem->elem.color.r = R;
  126.     elem->elem.color.g = G;
  127.     elem->elem.color.b = B;
  128.     elem->elem.color.a = A;
  129.     elem->elem.glowColor.r = glowR;
  130.     elem->elem.glowColor.g = glowG;
  131.     elem->elem.glowColor.b = glowB;
  132.     elem->elem.glowColor.a = glowA;
  133.     return elem;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement