Advertisement
Guest User

[PMT] Hit Indicator

a guest
Aug 12th, 2015
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.68 KB | None | 0 0
  1. {$CLEO .cs}
  2. {$NOSOURCE}
  3. 0000: NOP
  4. 0662: "PopandauL"
  5.  
  6. thread '$/*hiti'
  7.  
  8. if
  9. 8AF7: get_samp_base_to 33@
  10. then
  11. 0A93: end_custom_thread
  12. end
  13. repeat
  14. wait 400
  15. until 0AFA: is_samp_structures_available
  16.  
  17. wait 0
  18. 0BE1: raknet setup_outcoming_RPC_hook @rpcHook
  19.  
  20. wait 0
  21. if 0AAB: file_exists "CLEO\HitIndicator.ini"
  22. then
  23. 0AF0: 10@ = get_int_from_ini_file "cleo\HitIndicator.ini" section "Texture" key "ID"
  24. 0AF2: 11@ = get_float_from_ini_file "cleo\HitIndicator.ini" section "Texture" key "SizeX"
  25. 0AF2: 12@ = get_float_from_ini_file "cleo\HitIndicator.ini" section "Texture" key "SizeY"
  26. 0AF0: 13@ = get_int_from_ini_file "cleo\HitIndicator.ini" section "Texture" key "TimeMS"
  27. 0AF0: 30@ = get_int_from_ini_file "cleo\HitIndicator.ini" section "Toggle" key "Startup"
  28. 0AF0: 16@ = get_int_from_ini_file "cleo\HitIndicator.ini" section "Toggle" key "Key1"
  29. 0AF0: 17@ = get_int_from_ini_file "cleo\HitIndicator.ini" section "Toggle" key "Key2"
  30. else
  31. 0A93: end_custom_thread
  32. end
  33.  
  34. wait 0
  35. 03F0: enable_text_draw 1
  36. Player.Defined($PLAYER_ACTOR)
  37.  
  38. wait 0
  39. 14@ = -1
  40. 15@ = -1
  41. 0085: 32@ = 13@
  42. 0085: 33@ = 13@
  43.  
  44. wait 0
  45. 0390: load_txd_dictionary 'HitI'
  46. 038F: load_texture "arrow" as 10@
  47.  
  48. while true
  49. wait 0
  50. if 8AAB: file_exists "CLEO\HitIndicator.cs"
  51. then
  52. 0A93: end_custom_thread
  53. end
  54. if and
  55. 0AB0: 16@
  56. 0AB0: 17@
  57. then
  58. if 30@ == 1
  59. then
  60. 30@ = 0
  61. 0AD1: show_formatted_text_highpriority "~w~HitIndicator ~r~disabled~w~." time 1200
  62. else
  63. 30@ = 1
  64. 0AD1: show_formatted_text_highpriority "~w~HitIndicator ~g~enabled~w~." time 1200
  65. end
  66. wait 250
  67. end
  68. if and
  69. 30@ == 1
  70. 002D: 13@ >= 32@
  71. 8118: actor $PLAYER_ACTOR dead
  72. then
  73. if and
  74. 14@ >= 0
  75. 1000 >= 14@
  76. then
  77. 0AB1: call_scm_func @getCameraAngle 0 angle_to 6@
  78. if 0B20: samp 7@ = actor_handle_by_samp_player_id 14@
  79. then
  80. 0AB1: call_scm_func @getAngleBetweenPeds 1 7@ angle_to 8@
  81. 0063: 6@ -= 8@
  82. 0085: 9@ = 13@
  83. 0062: 9@ -= 32@
  84. 0016: 9@ /= 10
  85. 074B: draw_texture 10@ position 320.0 224.0 scale 11@ 12@ angle 6@ color_RGBA 255 255 255 9@
  86. end
  87. end
  88. else
  89. 14@ = -1
  90. end
  91.  
  92. if and
  93. 30@ == 1
  94. 002D: 13@ >= 33@
  95. 8118: actor $PLAYER_ACTOR dead
  96. then
  97. if and
  98. 15@ >= 0
  99. 1000 >= 15@
  100. then
  101. 0AB1: call_scm_func @getCameraAngle 0 angle_to 6@
  102. if 0B20: samp 7@ = actor_handle_by_samp_player_id 15@
  103. then
  104. 0AB1: call_scm_func @getAngleBetweenPeds 1 7@ angle_to 8@
  105. 0063: 6@ -= 8@
  106. 0085: 9@ = 13@
  107. 0062: 9@ -= 33@
  108. 0016: 9@ /= 10
  109. 074B: draw_texture 10@ position 320.0 224.0 scale 11@ 12@ angle 6@ color_RGBA 255 255 255 9@
  110. end
  111. end
  112. else
  113. 15@ = -1
  114. end
  115. end
  116.  
  117. :getCameraAngle
  118. //0AB1: call_scm_func @getCameraAngle 0 angle_to 6@
  119. 068D: get_camera_position_to 2@ 3@ 4@
  120. 068E: get_camera_target_point_to 5@ 6@ 7@
  121. 0063: 5@ -= 2@ // (float)
  122. 0063: 6@ -= 3@ // (float)
  123. 0604: get_Z_angle_for_point 5@ 6@ store_to 7@
  124. 0AB2: ret 1 7@
  125.  
  126. :getAngleBetweenPeds
  127. 04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 0.0
  128. 04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
  129. 0063: 1@ -= 4@
  130. 0063: 2@ -= 5@
  131. 0604: get_Z_angle_for_point 1@ 2@ store_to 6@
  132. 6@ += 180.0
  133. 0AB2: ret 1 6@
  134.  
  135.  
  136. :rpcHook
  137. 0BE5: raknet 0@ = get_hook_param 0
  138. 0BE5: raknet 1@ = get_hook_param 1
  139. if
  140. 1@ == 115
  141. then
  142. 3@ = BitStream.Read(0@, 1)
  143. 4@ = BitStream.Read(0@, 2)
  144. 5@ = BitStream.Read(0@, 4)
  145. if 3@ == 1
  146. then
  147. if 003B: 4@ == 14@
  148. then
  149. 0085: 14@ = 4@
  150. 32@ = 0
  151. else
  152. if 003B: 4@ == 15@
  153. then
  154. 0085: 15@ = 4@
  155. 33@ = 0
  156. else
  157. if 14@ == -1
  158. then
  159. 0085: 14@ = 4@
  160. 32@ = 0
  161. else
  162. if 15@ == -1
  163. then
  164. 0085: 15@ = 4@
  165. 33@ = 0
  166. else
  167. if 002D: 32@ >= 33@
  168. then
  169. 0085: 14@ = 4@
  170. 32@ = 0
  171. else
  172. 0085: 15@ = 4@
  173. 33@ = 0
  174. end
  175. end
  176. end
  177. end
  178. end
  179. end
  180. end
  181. 0BE0: raknet hook_ret 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement