Advertisement
jayd00

Snipets

Sep 10th, 2014
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.41 KB | None | 0 0
  1. {
  2. GTA SA Check Car Immunities
  3. }
  4. const
  5. ANY_CAR = 0@
  6. BULLETP = 1@
  7. FIREP = 2@
  8. EXPLOSIONP = 3@
  9. CRASHP = 4@
  10. end
  11. 0AB1: call_scm_func @getCarImmunities 1 car_handle: ANY_CAR store_to: BULLETP FIREP EXPLOSIONP CRASHP
  12.  
  13. :getCarImmunities
  14. 0A97: 10@ = car 0@ struct
  15. 000A: 10@ += 66
  16. 0A8D: 11@ = read_memory 10@ size 1 virtual_protect 0
  17. if
  18. 11@ >= 128
  19. then
  20. 23@ = 1 // Explosionproof = True
  21. 11@ -= 128
  22. else
  23. 23@ = 0 // Explosionproof = False
  24. end
  25. if
  26. 11@ >= 16
  27. then
  28. 24@ = 1 // Crashproof = True
  29. 11@ -= 16
  30. else
  31. 24@ = 0 // Crashproof = False
  32. end
  33. if
  34. 11@ >= 8
  35. then
  36. 22@ = 1 // Fireproof = True
  37. 11@ -= 8
  38. else
  39. 22@ = 0 // Fireproof = False
  40. end
  41. if
  42. 11@ == 4
  43. then
  44. 21@ = 1 // Bulletproof = True
  45. else
  46. 21@ = 0 // Bulletproof = False
  47. end
  48. 0AB2: ret 4 21@ 22@ 23@ 24@
  49.  
  50.  
  51. {
  52. Display Car name by scm function.
  53. }
  54. 0AB1: call_scm_func @CarNameByID 1 #landstal 0@
  55.  
  56. :CarNameByID
  57. 0@ *= 4
  58. 0@ += 0xA9B0C8
  59. 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
  60. 0@ += 0x32
  61. 0AA8: call_function_method 0x6A0050 struct 0xC1B340 num_params 1 pop 0 0@ 0@
  62. 0AB2: ret 1 0@
  63.  
  64.  
  65. {
  66. Change Color race checkpoint
  67. }
  68.  
  69. 0AB1: call_scm_func @RacingCheckpointColour 4 set_racing_checkpoint 0@ colour_red_to 255 green 255 blue 255
  70.  
  71. :RacingCheckpointColour
  72. {
  73. 0AB1: call_scm_func @RacingCheckpointColour 4 set_racing_checkpoint 0@ colour_red_to 255 green 255 blue 255
  74. Desc
  75. Sets racing checkpoint colour.
  76. Params
  77. 0@ - Checkpoint handle
  78. 1@ - Checkpoint red channel
  79. 2@ - Checkpoint green channel
  80. 3@ - Checkpoint blue channel
  81. Returned
  82. None.
  83. }
  84. for 4@ = 0xC7F15C to 0xC7F824 step 0x38
  85. 0A8D: 5@ = read_memory 4@ size 4 virtual_protect 0
  86. if
  87. 003B: 0@ == 5@
  88. then
  89. 000A: 4@ += 4
  90. 0A8C: write_memory 4@ size 1 value 1@ virtual_protect 0
  91. 000A: 4@ += 1
  92. 0A8C: write_memory 4@ size 1 value 2@ virtual_protect 0
  93. 000A: 4@ += 1
  94. 0A8C: write_memory 4@ size 1 value 3@ virtual_protect 0
  95. break
  96. end
  97. end
  98. 0AB2: ret 0
  99.  
  100. {
  101. Get Player MAX breath
  102. }
  103. AB1: call_scm_func @getPlayerMaxBreath 0 store_to 1@
  104.  
  105. :getPlayerMaxBreath
  106. {
  107. Parameters:
  108. Passed:
  109. none
  110. Result:
  111. 0@ - max lung capacity
  112. Example:
  113. 0AB1: call_scm_func @getPlayerMaxBreath 0 store_to 1@
  114. }
  115. 0653: 0@ = float_stat 225 // lung capacity stat
  116. 0653: 1@ = float_stat 22 // stamina stat
  117. 005B: 0@ += 1@
  118. 0@ *= 1.5
  119. 0@ += 1000.0
  120. if
  121. 0@ < 1150.0
  122. then
  123. 0@ = 1150.0
  124. end
  125. 0AB2: ret 1 0@
  126.  
  127. {
  128. Subtract Money function
  129. }
  130. if 0AB1: call_scm_func @Money_subtract 1 money_to_subtract 4000
  131. then
  132. /// money have been subtracted
  133. end
  134. :Money_subtract
  135. {
  136. Type: IF and SET
  137.  
  138. Parameters:
  139. Passed:
  140. 0@ - money to subtract
  141. Result:
  142. True or false. True when money have been subtracted
  143. Example:
  144. if 0AB1: call_scm_func @Money_subtract 1 money_to_subtract 4000
  145. }
  146. 010B: 1@ = player $PLAYER_CHAR money
  147. if
  148. 002D: 1@ >= 0@ // (int)
  149. then
  150. 0@ *= -1
  151. Player.Money($PLAYER_CHAR) += 0@
  152. 0485: return_true
  153. 0AB2: ret 0
  154. else
  155. 059A: return_false
  156. 0AB2: ret 0
  157. end
  158.  
  159. {
  160. Player rotate where aiming, without weapon.
  161. }
  162. if
  163. 00E1: player 0 pressed_key 6 // aim weapon
  164. then
  165. 068E: get_camera_target_point_to 0@ 1@ 2@
  166. 068D: get_camera_position_to 2@ 3@ 4@
  167. var
  168. 0@: float
  169. 1@: float
  170. 2@: float
  171. 3@: float
  172. end
  173. dec(0@, 2@)
  174. dec(1@, 3@)
  175. 0604: get_Z_angle_for_point 0@ 1@ store_to 2@
  176. 0173: set_actor $PLAYER_ACTOR Z_angle_to 2@
  177. end
  178.  
  179.  
  180. {
  181. Save objects in Memory Pool // CLEO 4
  182. }
  183. for 0@ = 0 to 9
  184. 0093: 1@ = integer 0@ to_float
  185. 04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 1@ 0.0
  186. 0107: 2@ = create_object #KNIFECUR at 5@ 6@ 7@
  187. 0AC6: 30@ = label @pool offset
  188. 0085: 4@ = 0@ // (int)
  189. 0012: 4@ *= 4
  190. 005A: 30@ += 4@ // (int)
  191. 0A8C: write_memory 30@ size 4 value 2@ virtual_protect 0
  192.  
  193. 04C4: store_coords_to 5@ 6@ 7@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 1@
  194. 0107: 3@ = create_object #KATANA at 5@ 6@ 7@
  195. 0AC6: 30@ = label @pool offset
  196. 0085: 4@ = 0@ // (int)
  197. 0012: 4@ *= 4
  198. 005A: 30@ += 4@ // (int)
  199. 000A: 30@ += 40
  200. 0A8C: write_memory 30@ size 4 value 3@ virtual_protect 0
  201. end
  202.  
  203. wait 2000
  204.  
  205. for 0@ = 0 to 9
  206. 0AC6: 30@ = label @pool offset
  207. 0085: 4@ = 0@ // (int)
  208. 0012: 4@ *= 4
  209. 005A: 30@ += 4@ // (int)
  210. 0A8D: 2@ = read_memory 30@ size 4 virtual_protect 0
  211. if
  212. 03CA: object 2@ exists
  213. then
  214. 0108: destroy_object 2@
  215. end
  216.  
  217. 0AC6: 30@ = label @pool offset
  218. 0085: 4@ = 0@ // (int)
  219. 0012: 4@ *= 4
  220. 005A: 30@ += 4@ // (int)
  221. 000A: 30@ += 40
  222. 0A8D: 3@ = read_memory 30@ size 4 virtual_protect 0
  223. if
  224. 03CA: object 3@ exists
  225. then
  226. 0108: destroy_object 3@
  227. end
  228. end
  229.  
  230. :pool
  231. hex
  232. //2@ - knife pool - 40byte
  233. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  234.  
  235. //3@ - katana pool - 40byte
  236. 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
  237. end
  238.  
  239.  
  240. {
  241. Get Angle Between Points function
  242. }
  243.  
  244. 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
  245. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 1@ 2@ and_XY 0.0 0.0 store_to 4@
  246. 0173: set_actor $PLAYER_ACTOR Z_angle_to 4@
  247.  
  248.  
  249. :getAngleBetweenPoints
  250. {
  251. Parameters:
  252. Passed:
  253. 0@ - 1st point X
  254. 1@ - 1st point Y
  255. 2@ - 2nd point X
  256. 3@ - 2nd point Y
  257. Result:
  258. 4@ - absolute angle
  259.  
  260. Example:
  261. 0AB1: call_scm_func @getAngleBetweenPoints 4 from_XY 0.0 0.0 and_XY 1.0 0.0 store_to 1@
  262. }
  263. 0063: 0@ -= 2@
  264. 0063: 1@ -= 3@
  265. 0604: get_Z_angle_for_point 0@ 1@ store_to 4@
  266. 0AB2: ret 1 4@
  267.  
  268.  
  269. {
  270. Get CAR Exhaust Pipe Offset
  271. }
  272.  
  273. 03C0: 0@ = actor $PLAYER_ACTOR car
  274. 0AB1: call_scm_func @GetExhaustPipeOffset 1 car 0@ offset 1@ 2@ 3@
  275.  
  276. :GetExhaustPipeOffset
  277. 0A97: 0@ = car 0@ struct
  278. 0@ += 0x22
  279. 0A8D: 0@ = read_memory 0@ size 2 virtual_protect 0 //model index
  280. 0@ *= 4
  281. 0@ += 0xA9B0C8
  282. 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 //CModel
  283. 0@ += 0x5C
  284. 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 //vehicle struct
  285. 0@ += 0x48
  286. 0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0 //x
  287. 0@ += 4
  288. 0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0 //y
  289. 0@ += 4
  290. 0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0 //z
  291. 0AB2: ret 3 1@ 2@ 3@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement