Advertisement
Guest User

Colorful HUDs.

a guest
Feb 28th, 2015
968
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. //------------------------------------------------------------------------------
  4.  
  5. #define hud_red -16776961
  6. #define hud_green 16711935
  7. #define hud_fuchsia -16711681
  8. #define hud_cyan 16777215
  9. #define hud_orange -5963521
  10. #define hud_maroon -2147483393
  11. #define hud_yellow -65281
  12. #define hud_blue 65535
  13. #define hud_brown -1523963137
  14. #define hud_lightblue -1378294017
  15. #define hud_purple -2147450625
  16. #define hud_grey -2139062017
  17. #define hud_lime 16711935
  18.  
  19. //------------------------------------------------------------------------------
  20.  
  21. #define hud_fist 1
  22. #define hud_cash 2
  23. #define hud_cashicon 3
  24.  
  25. //------------------------------------------------------------------------------
  26.  
  27. new Text:Fist, Text:Cash, Text:CashIcon, Hud[MAX_PLAYERS];
  28.  
  29. //------------------------------------------------------------------------------
  30.  
  31. stock SetPlayerHudColor(playerid, hud, hud_colors)
  32. {
  33. if(hud == hud_fist)
  34. {
  35. TextDrawColor(Fist, hud_colors);
  36. TextDrawShowForPlayer(playerid, Fist);
  37. }
  38. else if(hud == hud_cash)
  39. {
  40. TextDrawColor(Cash, hud_colors);
  41. TextDrawShowForPlayer(playerid, Cash);
  42. Hud[playerid] = 1;
  43. }
  44. else if(hud == hud_cashicon)
  45. {
  46. TextDrawColor(CashIcon, hud_colors);
  47. TextDrawShowForPlayer(playerid, CashIcon);
  48. }
  49. }
  50.  
  51. //------------------------------------------------------------------------------
  52.  
  53. stock RemovePlayerFistHud(playerid)
  54. {
  55. TextDrawHideForPlayer(playerid, Fist);
  56. }
  57.  
  58. //------------------------------------------------------------------------------
  59.  
  60. stock RemovePlayerCashHud(playerid)
  61. {
  62. TextDrawHideForPlayer(playerid, Cash);
  63. Hud[playerid] = 0;
  64. }
  65.  
  66. //------------------------------------------------------------------------------
  67.  
  68. stock RemovePlayerCashIconHud(playerid)
  69. {
  70. TextDrawHideForPlayer(playerid, CashIcon);
  71. }
  72.  
  73. //------------------------------------------------------------------------------
  74.  
  75. stock RemovePlayerHuds(playerid)
  76. {
  77. TextDrawHideForPlayer(playerid, Cash);
  78. TextDrawHideForPlayer(playerid, Fist);
  79. TextDrawHideForPlayer(playerid, CashIcon);
  80. Hud[playerid] = 0;
  81. }
  82.  
  83. //------------------------------------------------------------------------------
  84.  
  85. public OnFilterScriptInit()
  86. {
  87. Fist = TextDrawCreate(496.799957, 20.159988, "hud:fist");
  88. TextDrawLetterSize(Fist, 0.000000, 0.000000);
  89. TextDrawTextSize(Fist, 47.200027, 56.000022);
  90. TextDrawAlignment(Fist, 1);
  91. TextDrawColor(Fist, -65281);
  92. TextDrawSetShadow(Fist, 0);
  93. TextDrawSetOutline(Fist, 0);
  94. TextDrawFont(Fist, 4);
  95.  
  96. //--------------------------------------------------------------------------
  97.  
  98. Cash = TextDrawCreate(511.199951, 75.413330, "00000000");
  99. TextDrawLetterSize(Cash, 0.579600, 2.510933);
  100. TextDrawAlignment(Cash, 1);
  101. TextDrawColor(Cash, 8388863);
  102. TextDrawSetShadow(Cash, 0);
  103. TextDrawSetOutline(Cash, 1);
  104. TextDrawBackgroundColor(Cash, 51);
  105. TextDrawFont(Cash, 3);
  106. TextDrawSetProportional(Cash, 1);
  107.  
  108. //--------------------------------------------------------------------------
  109.  
  110. CashIcon = TextDrawCreate(495.999969, 73.920028, "$");
  111. TextDrawLetterSize(CashIcon, 0.571600, 2.772265);
  112. TextDrawAlignment(CashIcon, 1);
  113. TextDrawColor(CashIcon, 41215);
  114. TextDrawSetShadow(CashIcon, 0);
  115. TextDrawSetOutline(CashIcon, 1);
  116. TextDrawBackgroundColor(CashIcon, 51);
  117. TextDrawFont(CashIcon, 2);
  118. TextDrawSetProportional(CashIcon, 1);
  119. return 1;
  120. }
  121.  
  122. //------------------------------------------------------------------------------
  123.  
  124. public OnPlayerUpdate(playerid)
  125. {
  126. new string[20];
  127. if(Hud[playerid] == 1)
  128. {
  129. format(string, sizeof(string), "%08d", GetPlayerMoney(playerid));
  130. TextDrawSetString(Cash, string);
  131. TextDrawShowForPlayer(playerid, Cash);
  132. }
  133. return 1;
  134. }
  135.  
  136. //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement