Advertisement
legend2360

[CLEO] AutoReconnect

Jan 29th, 2015
753
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. {$CLEO}
  2. {$INCLUDE SF}
  3.  
  4. 0001: wait 0 ms
  5. 0662: "by legend2360"
  6. 0662: "BlastHack - cheating is art"
  7.  
  8. while not SAMP.Available()
  9. wait 400
  10. end
  11.  
  12. 1@ = false // disconnect status
  13.  
  14. 0BE4: raknet setup_incoming_packet_hook @inpacket_hook
  15.  
  16. while true
  17. wait 0
  18. if 1@ == true
  19. then
  20. 0B28: samp disconnect_with_reason 1
  21. 0ACC: show_text_lowpriority "~r~ Restarting..." time 3000
  22.  
  23. 0BFE: 2@ = get_tick_count
  24. 3@ = 0 // clear last saved time
  25. while 3@ < 18000
  26. wait 0
  27. 0BFE: 3@ = get_tick_count
  28. 0062: 3@ -= 2@
  29. end
  30.  
  31. alloc 4@ 16 // 255.255.255.255 = 4*3 + 3 = 15 (+1 for \0)
  32. 0B39: samp get_current_server_address 4@ port 5@
  33. 0B38: samp connect_to_server ip 4@ port 5@
  34. free 4@
  35.  
  36. 1@ = false
  37. end
  38. end
  39.  
  40. :inpacket_hook
  41. 0BE5: raknet 0@ = get_hook_param PARAM_PACKETID
  42. if or
  43. 0@ == 0x1E // PACKET_DISCONNECTION_NOTIFICATION
  44. 0@ == 0x21 // PACKET_CONNECTION_LOST
  45. 0@ == 0x22 // PACKET_CONNECTION_BANNED
  46. 0@ == 0x25 // PACKET_CONNECTION_ATTEMPT_FAILED
  47. then
  48. 1@ = true // Disconnected
  49. end
  50. 0BE0: raknet hook_ret true
  51.  
  52. {
  53. % TAGS
  54. AUTO
  55. RECONNECT
  56. CLEO
  57. SAMP
  58. SA-MP
  59. SA MP
  60. SAMPFUNCS
  61. авто
  62. реконнект
  63. переподключение
  64. автомататическое
  65. legend2360
  66. blasthack
  67. blast hack
  68. net
  69. .net
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement