Advertisement
RionKillikus

fn_hudUpdate

May 12th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2.  
  3. //---------------------------------
  4. //By Repentz
  5. //---------------------------------
  6.  
  7.  
  8. #define INFINITE 1e+1000
  9. #define IDC_LIFE_BAR_FOOD 2200
  10. #define IDC_LIFE_BAR_FOOD_RING 3200
  11. #define IDC_LIFE_BAR_WATER 2201
  12. #define IDC_LIFE_BAR_WATER_RING 3201
  13. #define IDC_LIFE_BAR_HEALTH 2202
  14. #define IDC_LIFE_BAR_HEALTH_RING 3202
  15. #define IDC_LIFE_BAR_Speaker 3007
  16. #define IDC_LIFE_BAR_SeatBelt 4203
  17.  
  18. disableSerialization;
  19. if(isNull LIFEdisplay) then {[] call life_fnc_hudSetup;};
  20.  
  21. //[LIFE_ID_PlayerTags,"onEachFrame"] call BIS_fnc_removeStackedEventHandler;
  22. LIFE_ID_PlayerTags = ["LIFE_PlayerTags","onEachFrame","life_fnc_playerTags"] call BIS_fnc_addStackedEventHandler;
  23.  
  24. if(!isNil "life_seatbelt") then {
  25. if ( vehicle player != player ) then {
  26. if(life_seatbelt) then {
  27. LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "Altis_Life.Altis\textures\HUD\seatbeltOn.paa";
  28. } else {
  29. LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "Altis_Life.Altis\textures\HUD\seatbeltOff.paa";
  30. };
  31. } else {
  32. LIFEctrl(IDC_LIFE_BAR_SeatBelt) ctrlSetText "";
  33. };
  34. };
  35.  
  36. if(!isNil "life_fadeSound") then
  37. {
  38. if(life_fadeSound) then
  39. {
  40. LIFEctrl(IDC_LIFE_BAR_Speaker) ctrlSetText "Altis_Life.Altis\textures\HUD\earplugsY.paa";
  41. } else {
  42. LIFEctrl(IDC_LIFE_BAR_Speaker) ctrlSetText "Altis_Life.Altis\textures\HUD\earplugsN.paa";
  43. };
  44. };
  45.  
  46. if(!isNil "life_thirst") then
  47. {
  48. if (life_thirst <= 100) then
  49. {
  50. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water0.paa";
  51. };
  52.  
  53. if (life_thirst <= 90) then
  54. {
  55. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water1.paa";
  56. };
  57.  
  58. if (life_thirst <= 80) then
  59. {
  60. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water2.paa";
  61. };
  62.  
  63. if (life_thirst <= 70) then
  64. {
  65. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water3.paa";
  66. };
  67.  
  68. if (life_thirst <= 60) then
  69. {
  70. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water4.paa";
  71. };
  72.  
  73. if (life_thirst <= 50) then
  74. {
  75. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water5.paa";
  76. };
  77.  
  78. if (life_thirst <= 40) then
  79. {
  80. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water6.paa";
  81. };
  82.  
  83. if (life_thirst <= 30) then
  84. {
  85. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water7.paa";
  86. };
  87. if (life_thirst <= 20) then
  88. {
  89. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water8.paa";
  90. };
  91.  
  92. if (life_thirst <= 10) then
  93. {
  94. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water9.paa";
  95. };
  96.  
  97. if (life_thirst <= 0) then
  98. {
  99. LIFEctrl(IDC_LIFE_BAR_WATER_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\water10.paa";
  100. };
  101. };
  102.  
  103. if (damage player >= 0) then
  104. {
  105. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health0.paa";
  106. };
  107.  
  108. if (damage player >= 0.01) then
  109. {
  110. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health1.paa";
  111. };
  112.  
  113. if (damage player >= 0.02) then
  114. {
  115. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health2.paa";
  116. };
  117.  
  118. if (damage player >= 0.03) then
  119. {
  120. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health3.paa";
  121. };
  122.  
  123. if (damage player >= 0.07) then
  124. {
  125. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health4.paa";
  126. };
  127.  
  128. if (damage player >= 0.13) then
  129. {
  130. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health5.paa";
  131. };
  132.  
  133. if (damage player >= 0.2) then
  134. {
  135. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health6.paa";
  136. };
  137.  
  138. if (damage player >= 0.3) then
  139. {
  140. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health7.paa";
  141. };
  142.  
  143. if (damage player >= 0.4) then
  144. {
  145. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health8.paa";
  146. };
  147.  
  148. if (damage player >= 0.7) then
  149. {
  150. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health9.paa";
  151. };
  152.  
  153. if (damage player >= 1) then
  154. {
  155. LIFEctrl(IDC_LIFE_BAR_HEALTH_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\health10.paa";
  156. };
  157. };
  158.  
  159. if(!isNil "life_hunger") then
  160. {
  161. if (life_hunger <= 100) then
  162. {
  163. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food0.paa";
  164. };
  165.  
  166. if (life_hunger <= 90) then
  167. {
  168. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food1.paa";
  169. };
  170.  
  171. if (life_hunger <= 80) then
  172. {
  173. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food2.paa";
  174. };
  175.  
  176. if (life_hunger <= 70) then
  177. {
  178. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food3.paa";
  179. };
  180.  
  181. if (life_hunger <= 60) then
  182. {
  183. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food4.paa";
  184. };
  185.  
  186. if (life_hunger <= 50) then
  187. {
  188. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food5.paa";
  189. };
  190.  
  191. if (life_hunger <= 40) then
  192. {
  193. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food6.paa";
  194. };
  195.  
  196. if (life_hunger <= 30) then
  197. {
  198. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food7.paa";
  199. };
  200.  
  201. if (life_hunger <= 20) then
  202. {
  203. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food8.paa";
  204. };
  205.  
  206. if (life_hunger <= 10) then
  207. {
  208. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food9.paa";
  209. };
  210.  
  211. if (life_hunger <= 0) then
  212. {
  213. LIFEctrl(IDC_LIFE_BAR_FOOD_RING) ctrlSetText "Altis_Life.Altis\textures\HUD\food1.paa";
  214. };
  215. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement