Advertisement
Guest User

[PMT] Teleport Master

a guest
Aug 12th, 2015
1,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. {$CLEO .cs}
  2. {$NOSOURCE}
  3. 0000: NOP
  4. 0662: "PopandauL"
  5. thread 'PMT'
  6.  
  7. if
  8. 8AF7: get_samp_base_to 33@
  9. then
  10. 0A93: end_custom_thread
  11. end
  12. repeat
  13. wait 400
  14. until 0AFA: is_samp_structures_available
  15.  
  16. wait 0
  17. if and
  18. 8AAB: file_exists "CLEO\Teleports.ini"
  19. 8AAB: file_exists "CLEO\TeleportSettings.ini"
  20. then
  21. wait 3000
  22. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{FFFFFF}]: One of the ini files is missing." color 0xFFFFFF
  23. 0A93: end_custom_thread
  24. else
  25. wait 3000
  26. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{FFFFFF}]: Teleport.cs by {00B5FF}PopandauL {FFFFFF}was successfully loaded." color 0xFFFFFF
  27. 0AF0: 29@ = get_int_from_ini_file "cleo\TeleportSettings.ini" section "Keys" key "Key1"
  28. 0AF0: 28@ = get_int_from_ini_file "cleo\TeleportSettings.ini" section "Keys" key "Key2"
  29. end
  30.  
  31. wait 0
  32. 0B34: samp register_client_command "ptp" to_label @teleport
  33. 0B34: samp register_client_command "pcp" to_label @teleportcp
  34. 0B34: samp register_client_command "ptpc" to_label @teleportcoordinates
  35. 0B34: samp register_client_command "pspos" to_label @savepos
  36. 0B34: samp register_client_command "plpos" to_label @loadpos
  37. 0B34: samp register_client_command "pback" to_label @teleportback
  38. 0B34: samp register_client_command "pmthelp" to_label @pmthelp
  39.  
  40. while true
  41. wait 0
  42. if Player.Defined($PLAYER_ACTOR)
  43. then
  44. 0A8D: 12@ = read_memory 0xBA6774 size 1 virtual_protect 0
  45. if and
  46. 0AB0: 28@
  47. 0AB0: 29@
  48. 8039: 12@ == 0
  49. then
  50. 0AB6: store_target_marker_coords_to 5@ 6@ 7@
  51. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  52. 04E4: refresh_game_renderer_at 5@ 6@
  53. Camera.SetAtPos(5@, 6@, 7@)
  54. 00A1: put_actor $PLAYER_ACTOR at 5@ 6@ -100.0
  55. wait 500
  56. end
  57. end
  58. end
  59.  
  60. :teleport
  61. wait 0
  62. 0B35: samp 0@ = get_last_command_params
  63. if 0AD4: 30@ = scan_string 0@ format "%d" 0@
  64. then
  65. if 0B23: samp is_player_connected 0@
  66. then
  67. if 8B20: samp 4@ = actor_handle_by_samp_player_id 0@
  68. then
  69. 0B2F: samp get_streamed_out_player_pos 0@ to 1@ 2@ 3@
  70. else
  71. 00A0: store_actor 4@ position_to 1@ 2@ 3@
  72. end
  73. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  74. 04E4: refresh_game_renderer_at 1@ 2@
  75. Camera.SetAtPos(1@, 2@, 3@)
  76. Actor.PutAt($PLAYER_ACTOR,1@,2@,3@)
  77. else
  78. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Player not connected." color 0xE3E3E3
  79. end
  80. else
  81. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Please enter a valid ID." color 0xE3E3E3
  82. end
  83. Samp.CmdRet()
  84.  
  85. :teleportcp
  86. wait 0
  87. 17@ = 0
  88. for 13@ = 0 to 32
  89. if 0AB1: @GetMarkerPosition 1 13@ 14@ 15@ 16@
  90. then
  91. 17@ = 1
  92. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  93. 04E4: refresh_game_renderer_at 14@ 15@
  94. Camera.SetAtPos(14@, 15@, 16@)
  95. 00A1: put_actor $PLAYER_ACTOR at 14@ 15@ 16@
  96. end
  97. end
  98. if 17@ == 0
  99. then
  100. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: No checkpoint was found." color 0xE3E3E3
  101. end
  102. Samp.CmdRet()
  103.  
  104. :teleportcoordinates
  105. wait 0
  106. 0B35: samp 0@ = get_last_command_params
  107. if 0AD4: 30@ = scan_string 0@ format "%f %f %f" 1@ 2@ 3@
  108. then
  109. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  110. 04E4: refresh_game_renderer_at 1@ 2@
  111. Camera.SetAtPos(1@, 2@, 3@)
  112. 00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
  113. end
  114. Samp.CmdRet()
  115.  
  116. :savepos
  117. wait 0
  118. 0B35: samp 0@ = get_last_command_params
  119. if 0AD4: 30@ = scan_string 0@ format "%d" 0@
  120. then
  121. 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
  122. 0AD3: 4@v = format "%d" 0@
  123. 0AF3: write_float 1@ to_ini_file "cleo\Teleports.ini" section 4@v key "X"
  124. 0AF3: write_float 2@ to_ini_file "cleo\Teleports.ini" section 4@v key "Y"
  125. 0AF3: write_float 3@ to_ini_file "cleo\Teleports.ini" section 4@v key "Z"
  126. else
  127. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Please enter a valid teleport ID." color 0xE3E3E3
  128. end
  129. Samp.CmdRet()
  130.  
  131. :loadpos
  132. wait 0
  133. if 0AAB: file_exists "cleo\Teleports.ini"
  134. then
  135. 0B35: samp 0@ = get_last_command_params
  136. if 0AD4: 30@ = scan_string 0@ format "%d" 0@
  137. then
  138. 0AD3: 4@v = format "%d" 0@
  139. if and
  140. 0AF2: 1@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "X"
  141. 0AF2: 2@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "Y"
  142. 0AF2: 3@ = get_float_from_ini_file "cleo\Teleports.ini" section 4@v key "Z"
  143. then
  144. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  145. 00A1: put_actor $PLAYER_ACTOR at 1@ 2@ 3@
  146. else
  147. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Not a valid teleport ID." color 0xE3E3E3
  148. end
  149. else
  150. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Please enter a valid teleport ID." color 0xE3E3E3
  151. end
  152. else
  153. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: Teleports.ini was not found." color 0xE3E3E3
  154. end
  155. Samp.CmdRet()
  156.  
  157. :teleportback
  158. wait 0
  159. if and
  160. 8043: 9@ == 0.0
  161. 8043: 10@ == 0.0
  162. 8043: 11@ == 0.0
  163. then
  164. 0087: 18@ = 9@
  165. 0087: 19@ = 10@
  166. 0087: 20@ = 11@
  167. 00A0: store_actor $PLAYER_ACTOR position_to 9@ 10@ 11@
  168. 00A1: put_actor $PLAYER_ACTOR at 18@ 19@ 20@
  169. else
  170. 0AF8: samp add_message_to_chat "[{BAFF00}PMT{E3E3E3}]: A valid previous position was not found." color 0xE3E3E3
  171. end
  172. Samp.CmdRet()
  173.  
  174. :pmthelp
  175. wait 0
  176. 0AC6: 20@ = label @help offset
  177. 0B3B: samp show_dialog id 2 caption "Mod by PopandauL" text 20@ button_1 "Close" button_2 "" style 0
  178. Samp.CmdRet()
  179.  
  180. :help
  181. hex
  182. 7b 46 46 46 46 46 46 7d 43 6f 6d 6d 61 6e 64
  183. 73 3a 0d 0a 7b 30 32 46 36 45 42 7d 2f 70 74
  184. 70 7b 43 30 46 46 30 31 7d 3a 20 74 65 6c 65
  185. 70 6f 72 74 20 74 6f 20 61 20 70 6c 61 79 65
  186. 72 20 28 65 67 2e 20 2f 70 74 70 20 31 30 29
  187. 2e 0d 0a 7b 30 32 46 36 45 42 7d 2f 70 63 70
  188. 7b 43 30 46 46 30 31 7d 3a 20 74 65 6c 65 70
  189. 6f 72 74 20 74 6f 20 63 68 65 63 6b 70 6f 69
  190. 6e 74 20 28 65 67 2e 20 2f 70 63 70 29 2e 0d
  191. 0a 7b 30 32 46 36 45 42 7d 2f 70 74 70 63 7b
  192. 43 30 46 46 30 31 7d 3a 20 74 65 6c 65 70 6f
  193. 72 74 20 74 6f 20 63 6f 6f 72 64 69 6e 61 74
  194. 65 73 20 28 65 67 2e 20 2f 70 74 70 63 20 31
  195. 30 30 2e 30 20 31 30 30 2e 30 20 32 35 30 2e
  196. 30 29 2e 0d 0a 7b 30 32 46 36 45 42 7d 2f 70
  197. 73 70 6f 73 7b 43 30 46 46 30 31 7d 3a 20 73
  198. 61 76 65 20 61 20 70 6f 73 69 74 69 6f 6e 20
  199. 75 6e 64 65 72 20 61 20 64 65 63 69 6d 61 6c
  200. 20 6e 61 6d 65 20 28 65 67 2e 20 2f 70 73 70
  201. 6f 73 20 32 29 2e 0d 0a 7b 30 32 46 36 45 42
  202. 7d 2f 70 6c 70 6f 73 7b 43 30 46 46 30 31 7d
  203. 3a 20 6c 6f 61 64 20 61 20 70 6f 73 69 74 69
  204. 6f 6e 20 28 65 67 2e 20 2f 70 6c 70 6f 73 20
  205. 32 29 2e 0d 0a 7b 30 32 46 36 45 42 7d 2f 70
  206. 62 61 63 6b 7b 43 30 46 46 30 31 7d 3a 20 74
  207. 65 6c 65 70 6f 72 74 20 62 61 63 6b 20 74 6f
  208. 20 79 6f 75 72 20 6c 61 73 74 20 70 6f 73 69
  209. 74 69 6f 6e 2e 00
  210. end
  211.  
  212. :GetMarkerPosition
  213. //0AB1: @GetMarkerPosition 1 0@ 1@ 2@ 3@
  214. 0@ *= 0xA0
  215. 0@ += 0xC7DD58
  216. 0@ += 0x30
  217. 0A8D: 1@ = read_memory 0@ size 4 virtual_protect 0
  218. 0@ += 0x4
  219. 0A8D: 2@ = read_memory 0@ size 4 virtual_protect 0
  220. 0@ += 0x4
  221. 0A8D: 3@ = read_memory 0@ size 4 virtual_protect 0
  222. 0@ += 0x1A
  223. 0A8D: 4@ = read_memory 0@ size 1 virtual_protect 0
  224. if and
  225. 1@ == 1099.551025
  226. 2@ == 1601.496948
  227. 3@ == 11.555000
  228. then
  229. 5@ = 0
  230. else
  231. 5@ = 1
  232. if and
  233. 1@ == 2695.624023
  234. 2@ == -1704.687988
  235. 3@ == 10.844000
  236. then
  237. 6@ = 0
  238. else
  239. 6@ = 1
  240. if and
  241. 1@ == 0.0
  242. 2@ == 0.0
  243. 3@ == 0.0
  244. then
  245. 7@ = 0
  246. else
  247. 7@ = 1
  248. end
  249. end
  250. end
  251.  
  252. if and
  253. 4@ == 1
  254. 5@ == 1
  255. 6@ == 1
  256. 7@ == 1
  257. then
  258. 0485: return_true
  259. else
  260. 059A: return_false
  261. end
  262. 0AB2: ret 3 1@ 2@ 3@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement