Advertisement
danya777_kirov

Sync (not full)

Jul 24th, 2013
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.79 KB | None | 0 0
  1. {$Include includes\RakNetDefines.txt}
  2.  
  3. /*
  4.  
  5.     SAMP SYNC:
  6.         PASSENGER
  7.         AIM
  8.         TRAILER
  9.         ONFOOT
  10.         INCAR
  11.         HEAD (future)
  12.         SURF (future)
  13.         DAMAGE(INCAR) (future)
  14.         SPECTATE (future)
  15.         UNOCCUPIED (future)
  16.  
  17. */
  18.  
  19. /*
  20.  
  21.   PASSENGERDATA, 11 ARGUMENTS
  22.  
  23. */
  24.  
  25. :PassengerData // size 0x18 byte
  26. 29@ = SAMP.GetSAMPPlayerIDByActorHandle($player_actor)
  27. 29@ = SAMP.GetPlayerStruct(29@)
  28. //0C0D: struct 29@ offset 0x0 size 0x2 = 0@ // VehicleID
  29. //0C0D: struct 29@ offset 0x2 size 0x1 = 1@ // SeatID
  30. //0C0D: struct 29@ offset 0x3 size 0x1 = 2@ // CurrentWeapon
  31. //0C0D: struct 29@ offset 0x4 size 0x1 = 3@ // Health
  32. //0C0D: struct 29@ offset 0x5 size 0x1 = 4@ // Armor
  33. //0C0D: struct 29@ offset 0x6 size 0x2 = 5@ // LeftRightKeys
  34. //0C0D: struct 29@ offset 0x8 size 0x2 = 6@ // UpDownKeys
  35. //0C0D: struct 29@ offset 0xA size 0x2 = 7@ // Keys
  36. //0C0D: struct 29@ offset 0xC size 0x4 = 8@ // PositionX
  37. //0C0D: struct 29@ offset 0x10 size 0x4 = 9@ // PositionY
  38. //0C0D: struct 29@ offset 0x14 size 0x4 = 10@ // PositionZ
  39. 30@ = RakNet.NewBitStream()
  40. RakNet.Write(30@, PACKET_PASSENGER_SYNC, BS_TYPE_BYTE, 1)
  41. RakNet.Write(30@, 29@, BS_TYPE_ARRAY, 0x18)
  42. RakNet.Send(30@, PRIORITY_HIGH, UNRELIABLE_SEQUENCED, 0)
  43. RakNet.DeleteBitStream(30@)
  44. 0AB2: return 0
  45.  
  46. /*
  47.  
  48.     AIMDATA, 10 ARGUMENTS
  49.  
  50. */
  51.  
  52. :AimData // size 0x20 byte
  53. 29@ = SAMP.GetSAMPPlayerIDByActorHandle($player_actor)
  54. 29@ = SAMP.GetPlayerStruct(29@)
  55. 29@ += 0x18
  56. //0C0D: struct 29@ offset 0x0 size 0x1 = 0@ // CamMode
  57. //0C0D: struct 29@ offset 0x1 size 0x4 = 1@ // Aimf1X
  58. //0C0D: struct 29@ offset 0x5 size 0x4 = 2@ // Aimf1Y
  59. //0C0D: struct 29@ offset 0x9 size 0x4 = 3@ // Aimf1Z
  60. //0C0D: struct 29@ offset 0xD size 0x4 = 4@ // AimPosX
  61. //0C0D: struct 29@ offset 0x11 size 0x4 = 5@ // AimPosY
  62. //0C0D: struct 29@ offset 0x15 size 0x4 = 6@ // AimPosZ
  63. //0C0D: struct 29@ offset 0x19 size 0x4 = 7@ // AimZ
  64. //0C0D: struct 29@ offset 0x1D size 0x1 = 8@ // CamExtZoom
  65. //0C0D: struct 29@ offset 0x1E size 0x1 = 9@ // WeaponState
  66. 30@ = RakNet.NewBitStream()
  67. RakNet.Write(30@, PACKET_AIM_SYNC, BS_TYPE_BYTE, 1)
  68. RakNet.Write(30@, 29@, BS_TYPE_ARRAY, 0x20)
  69. RakNet.Send(30@, PRIORITY_HIGH, UNRELIABLE_SEQUENCED, 0)
  70. RakNet.DeleteBitStream(30@)
  71. 0AB2: return 0  
  72.  
  73. /*
  74.  
  75.     TRAILERDATA, 14 ARGUMENTS
  76.  
  77. */
  78.  
  79. :TrailerData // size 0x36 byte
  80. 29@ = SAMP.GetSAMPPlayerIDByActorHandle($player_actor)
  81. 29@ = SAMP.GetPlayerStruct(29@)
  82. 29@ += 0x18
  83. //0C0D: struct 29@ offset 0x0 size 0x2 = 0@ // TrailerID
  84. //0C0D: struct 29@ offset 0x2 size 0x4 = 1@ // DirectionX
  85. //0C0D: struct 29@ offset 0x6 size 0x4 = 2@ // DirectionY
  86. //0C0D: struct 29@ offset 0xA size 0x4 = 3@ // DirectionZ
  87. //0C0D: struct 29@ offset 0xE size 0x4 = 4@ // RollX
  88. //0C0D: struct 29@ offset 0x12 size 0x4 = 5@ // RollY
  89. //0C0D: struct 29@ offset 0x16 size 0x4 = 6@ // RollZ
  90. //0C0D: struct 29@ offset 0x1A size 0x4 = 7@ // PositionX
  91. //0C0D: struct 29@ offset 0x1E size 0x4 = 8@ // PositionY
  92. //0C0D: struct 29@ offset 0x22 size 0x4 = 9@ // PositionZ
  93. //0C0D: struct 29@ offset 0x26 size 0x4 = 10@ // SpeedX
  94. //0C0D: struct 29@ offset 0x2A size 0x4 = 11@ // SpeedY
  95. //0C0D: struct 29@ offset 0x2E size 0x4 = 12@ // SpeedZ
  96. //0C0D: struct 29@ offset 0x32 size 0x4 = 13@ // pad
  97. 30@ = RakNet.NewBitStream()
  98. RakNet.Write(30@, PACKET_TRAILER_SYNC, BS_TYPE_BYTE, 1)
  99. RakNet.Write(30@, 29@, BS_TYPE_ARRAY, 0x36)
  100. RakNet.Send(30@, PRIORITY_HIGH, UNRELIABLE_SEQUENCED, 0)
  101. RakNet.DeleteBitStream(30@)
  102. 0AB2: return 0
  103.  
  104. /*
  105.  
  106.     ONFOOTDATA, 22 ARGUMENTS
  107.  
  108. */
  109.  
  110. :OnFootData // size 0x44 byte
  111. 29@ = SAMP.GetSAMPPlayerIDByActorHandle($player_actor)
  112. 29@ = SAMP.GetPlayerStruct(29@)
  113. 29@ += 0x6D
  114. //0C0D: struct 29@ offset 0x0 size 0x2 = 0@ // LeftRightKeys
  115. //0C0D: struct 29@ offset 0x2 size 0x2 = 1@ // UpDownKeys
  116. //0C0D: struct 29@ offset 0x4 size 0x2 = 2@ // Keys
  117. //0C0D: struct 29@ offset 0x6 size 0x4 = 3@ // PositionX
  118. //0C0D: struct 29@ offset 0xA size 0x4 = 4@ // PositionY
  119. //0C0D: struct 29@ offset 0xE size 0x4 = 5@ // PositionZ
  120. //0C0D: struct 29@ offset 0x12 size 0x4 = 6@ // Quaternion
  121. //0C0D: struct 29@ offset 0x16 size 0x4 = 7@ //
  122. //0C0D: struct 29@ offset 0x1A size 0x4 = 8@ //
  123. //0C0D: struct 29@ offset 0x1E size 0x4 = 9@ //
  124. //0C0D: struct 29@ offset 0x22 size 0x1 = 10@ // Health
  125. //0C0D: struct 29@ offset 0x23 size 0x1 = 11@ // Armor
  126. //0C0D: struct 29@ offset 0x24 size 0x1 = 12@ // CurrentWeapon
  127. //0C0D: struct 29@ offset 0x25 size 0x1 = 13@ // SpecialAction
  128. //0C0D: struct 29@ offset 0x26 size 0x4 = 14@ // MoveSpeedX
  129. //0C0D: struct 29@ offset 0x2A size 0x4 = 15@ // MoveSpeedY
  130. //0C0D: struct 29@ offset 0x2E size 0x4 = 16@ // MoveSpeedZ
  131. //0C0D: struct 29@ offset 0x32 size 0x4 = 17@ // SurfingOffsetsX
  132. //0C0D: struct 29@ offset 0x36 size 0x4 = 18@ // SurfingOffsetsY
  133. //0C0D: struct 29@ offset 0x3A size 0x4 = 19@ // SurfingOffsetsZ
  134. //0C0D: struct 29@ offset 0x3E size 0x2 = 20@ // SurfingVehicleID
  135. //0C0D: struct 29@ offset 0x40 size 0x4 = 21@ // CurrentAnimationID
  136. 30@ = RakNet.NewBitStream()
  137. RakNet.Write(30@, PACKET_PLAYER_SYNC, BS_TYPE_BYTE, 1)
  138. RakNet.Write(30@, 29@, BS_TYPE_ARRAY, 0x44)
  139. RakNet.Send(30@, PRIORITY_HIGH, UNRELIABLE_SEQUENCED, 0)
  140. RakNet.DeleteBitStream(30@)
  141. 0AB2: return 0                          
  142.          
  143. /*
  144.  
  145.     INCARDATA, 22 ARGUMENTS
  146.  
  147. */        
  148.          
  149. :InCarData // size 0x3F byte
  150. 29@ = SAMP.GetSAMPPlayerIDByActorHandle($player_actor)
  151. 29@ = SAMP.GetPlayerStruct(29@)
  152. 29@ += 0xB1
  153. //0C0D: struct 29@ offset 0 size 0x2 = 0@ // VehicleID
  154. //0C0D: struct 29@ offset 2 size 0x2 = 1@ // LeftRightKeys
  155. //0C0D: struct 29@ offset 4 size 0x2 = 2@ // UpDownKeys
  156. //0C0D: struct 29@ offset 6 size 0x2 = 3@ // Keys
  157. //0C0D: struct 29@ offset 8 size 0x4 = 4@ // Quaternion
  158. //0C0D: struct 29@ offset 12 size 0x4 = 5@ //
  159. //0C0D: struct 29@ offset 16 size 0x4 = 6@ //
  160. //0C0D: struct 29@ offset 20 size 0x4 = 7@ //
  161. //0C0D: struct 29@ offset 24 size 0x4 = 8@ // PositionX
  162. //0C0D: struct 29@ offset 28 size 0x4 = 9@ // PositionY
  163. //0C0D: struct 29@ offset 32 size 0x4 = 10@ // PositionZ
  164. //0C0D: struct 29@ offset 36 size 0x4 = 11@ // MoveSpeedX
  165. //0C0D: struct 29@ offset 40 size 0x4 = 12@ // MoveSpeedY
  166. //0C0D: struct 29@ offset 44 size 0x4 = 13@ // MoveSpeedZ
  167. //0C0D: struct 29@ offset 48 size 0x4 = 14@ // VehicleHealth
  168. //0C0D: struct 29@ offset 52 size 0x1 = 15@ // PlayerHealth
  169. //0C0D: struct 29@ offset 53 size 0x1 = 16@ // Armor
  170. //0C0D: struct 29@ offset 54 size 0x1 = 17@ // CurrentWeapon
  171. //0C0D: struct 29@ offset 55 size 0x1 = 18@ // Siren
  172. //0C0D: struct 29@ offset 56 size 0x1 = 19@ // LandingGearState
  173. //0C0D: struct 29@ offset 57 size 0x2 = 20@ // TrailerID
  174. //0C0D: struct 29@ offset 59 size 0x4 = 21@ // TrainSpeed
  175. 30@ = RakNet.NewBitStream()
  176. RakNet.Write(30@, PACKET_VEHICLE_SYNC, BS_TYPE_BYTE, 1)
  177. RakNet.Write(30@, 29@, BS_TYPE_ARRAY, 0x3F)
  178. RakNet.Send(30@, PRIORITY_HIGH, UNRELIABLE_SEQUENCED, 0)
  179. RakNet.DeleteBitStream(30@)
  180. 0AB2: return 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement