gtarlRobbe

Indicator.cs

Feb 27th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.15 KB | None | 0 0
  1. {$CLEO}  // ?????? ?????? 0B10, 0B15. ????????? ???????? <> 0xFFFF
  2. const
  3.     0_VehicleHandle = 0@
  4.     0_VehicleStruct = 1@
  5.     0_TractorStruct = 2@
  6.         0_PointAdress = 2@
  7.             0_Adress = 2@
  8.                 0_VectorPointer = 2@
  9.     0_PrewPathPointID = 3@  // ?????? ?? ?????
  10.     0_CurrPathPointID = 4@
  11.     0_NextPathPointID = 5@
  12.     0_CarX = 6@
  13.         0_PrewX = 6@            // ?????? X ????????? ?????
  14.             0_FrontLightX = 6@
  15.     0_CarY = 7@
  16.         0_CurrX = 7@
  17.             0_FrontLightY = 7@
  18.     0_CarZ = 8@
  19.         0_NextX = 8@
  20.             0_FrontLightZ = 8@
  21.     0_CarCamDistForw = 9@
  22.         0_PrewY = 9@           // ?????? Y ????????? ?????
  23.             0_BackLightX = 9@
  24.     0_CarCamDistBack = 10@
  25.         0_CurrY = 10@
  26.             0_BackLightY = 10@
  27.     0_NextY = 11@
  28.         0_BackLightZ = 11@
  29.     0_CamX = 12@
  30.     0_CamY = 13@
  31.     0_CamZ = 14@
  32.     0_CurrentCarOfPlayer = 15@
  33.         0_VehicleType = 15@
  34.     0_OldCarOfPlayer = 16@
  35.     0_StatusOfPlayerCar = 17@
  36.     0_CamTargetMirrorX = 18@    
  37.     0_CamTargetMirrorY = 19@    
  38.     0_CamTargetMirrorZ = 20@    
  39.     0_CamTargetX = 21@    
  40.     0_CamTargetY = 22@    
  41.     0_CamTargetZ = 23@
  42.     0_CarDriver = 24@
  43.     0_UnicalNumberOfCorona = 25@
  44.     0_LightsStatus = 26@
  45.     0_Angle1 = 27@
  46.     0_Angle2 = 28@
  47.  
  48.     // 31@
  49.    
  50.     1_RadiusOfSearch = 200.0 // ?????? ?????? ??????????, ?
  51.    
  52.     // ??????:
  53.     1_Left = 1
  54.     1_Right = 2
  55.     1_Both = 3
  56. end
  57. 0_OldCarOfPlayer = -1
  58. while true
  59.     wait 0
  60.     if
  61.         not player.defined($player_char)
  62.     then
  63.         continue
  64.     end
  65.  
  66.     if
  67.         32@ > 1000
  68.     then
  69.         32@ = 0
  70.     end
  71.    
  72.     if and
  73.         actor.Driving($PLAYER_ACTOR)
  74.         84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle
  75.         84A7:   not actor $PLAYER_ACTOR driving_boat
  76.         89AE:   not actor $PLAYER_ACTOR driving_train
  77.         not actor.DrivingVehicleType($PLAYER_ACTOR #BMX)
  78.         not actor.DrivingVehicleType($PLAYER_ACTOR #BIKE)
  79.         not actor.DrivingVehicleType($PLAYER_ACTOR #MTBIKE)
  80.     then    
  81.         03C0: 0_CurrentCarOfPlayer = actor $PLAYER_ACTOR car
  82.         046C: 0_CarDriver = car 0_CurrentCarOfPlayer driver
  83.         if
  84.             003B:   0_CarDriver == $PLAYER_ACTOR // (int)
  85.         then
  86.             if
  87.                 803B:   not  0_CurrentCarOfPlayer == 0_OldCarOfPlayer // (int)      
  88.             then
  89.                 0_StatusOfPlayerCar = 0
  90.                 0085: 0_OldCarOfPlayer = 0_CurrentCarOfPlayer // (int)
  91.             end
  92.            
  93.             if
  94.                 0AB0:  key_pressed 90 // Z
  95.             then
  96.                 0_StatusOfPlayerCar = 1_Left
  97.             else
  98.                 if
  99.                     0AB0:  key_pressed 88 // X
  100.                 then
  101.                     0_StatusOfPlayerCar = 1_Both
  102.                 else
  103.                     if
  104.                         0AB0:  key_pressed 67 // C
  105.                     then
  106.                         0_StatusOfPlayerCar = 1_Right
  107.                     else
  108.                         if
  109.                             0AB0:  key_pressed 16 // Shift
  110.                         then
  111.                             0_StatusOfPlayerCar = 0
  112.                         end
  113.                     end                    
  114.                 end        
  115.             end
  116.         end // CJ -driver          
  117.     end  // actor driving
  118.  
  119.     068D: get_camera_position_to 0_CamTargetMirrorX 0_CamTargetMirrorY 0_CamTargetMirrorZ              
  120.     068E: get_camera_target_point_to 0_CamTargetX 0_CamTargetY 0_CamTargetZ  
  121.     0063: 0_CamTargetX -= 0_CamTargetMirrorX // (float)
  122.     0063: 0_CamTargetY -= 0_CamTargetMirrorY // (float)
  123.     0063: 0_CamTargetZ -= 0_CamTargetMirrorZ // (float)
  124.     0063: 0_CamTargetMirrorX -= 0_CamTargetX // (float)
  125.     0063: 0_CamTargetMirrorY -= 0_CamTargetY // (float)
  126.     0063: 0_CamTargetMirrorZ -= 0_CamTargetZ // (float)
  127.     068D: get_camera_position_to 0_CamX 0_CamY 0_CamZ
  128.     068E: get_camera_target_point_to 0_CamTargetX 0_CamTargetY 0_CamTargetZ
  129.    
  130.     0A9F: 0_UnicalNumberOfCorona = current_thread_pointer
  131.  
  132.     if
  133.         0AE2: 0_VehicleHandle = random_vehicle_near_point 0_CamX 0_CamY 0_CamZ in_radius 1_RadiusOfSearch find_next 0 pass_wrecked 1 //IF and SET
  134.     then
  135.         repeat
  136.             0A97: 0_VehicleStruct = car 0_VehicleHandle struct
  137.             0A8E: 0_VehicleType = 0_VehicleStruct + 1424 // int
  138.             0A8D: 0_VehicleType = read_memory 0_VehicleType size 1 virtual_protect 0
  139.             if and
  140.                 0_VehicleType <> 0
  141.                 0_VehicleType <> 9
  142.             then
  143.                 continue
  144.             end
  145.             0AA8: call_function_method 0x6D1080 struct 0_VehicleStruct num_params 0 pop 0 0_VehicleType // _CVehicleBase__getVehicleType
  146.             if and
  147.                 0_VehicleType <> 1
  148.                 0_VehicleType <> 2
  149.             then
  150.                 continue
  151.             end            
  152.             0A8E: 0_TractorStruct = 0_VehicleStruct + 0x4C4 // int
  153.             0A8D: 0_TractorStruct = read_memory 0_TractorStruct size 4 virtual_protect 0
  154.             car.StorePos(0_VehicleHandle 0_CarX 0_CarY 0_CarZ)
  155.             050A: 0_CarCamDistBack = distance_between_XYZ 0_CarX 0_CarY 0_CarZ and_XYZ 0_CamTargetMirrorX 0_CamTargetMirrorY 0_CamTargetMirrorZ
  156.             050A: 0_CarCamDistForw = distance_between_XYZ 0_CarX 0_CarY 0_CarZ and_XYZ 0_CamTargetX 0_CamTargetY 0_CamTargetZ          
  157.             if or
  158.                 0025:   0_CarCamDistForw > 0_CarCamDistBack // (float)
  159.                 0_TractorStruct > 0
  160.                 0137:  car 0_VehicleHandle model == #BMX
  161.                 0137:  car 0_VehicleHandle model == #BIKE
  162.                 0137:  car 0_VehicleHandle model == #MTBIKE
  163.                 0686:   car 0_VehicleHandle attached  
  164.             then                    
  165.                 continue
  166.             end
  167.             046C: 0_CarDriver = car 0_VehicleHandle driver
  168.             if and
  169.                 803B:   not  0_VehicleHandle == 0_OldCarOfPlayer // (int)  
  170.                 0_CarDriver <= 0
  171.             then
  172.                 continue
  173.             end    
  174.             if
  175.                 32@ <= 500
  176.             then
  177.                 gosub @Turn_signals_process
  178.             end  
  179.         until 8AE2: not 0_VehicleHandle = random_vehicle_near_point 0_CamX 0_CamY 0_CamZ in_radius 1_RadiusOfSearch find_next 1 pass_wrecked 1 //IF and SET
  180.     end    
  181. end
  182.  
  183. :Turn_signals_process    
  184. if
  185.     003B:   0_VehicleHandle == 0_OldCarOfPlayer // (int)
  186. then
  187.     0085: 0_LightsStatus = 0_StatusOfPlayerCar // (int)
  188.     gosub @Get_lights_coords
  189.     if or
  190.         0_LightsStatus == 1_Right
  191.         0_LightsStatus == 1_Both
  192.     then
  193.         0AC7: 0_VectorPointer = var 0_FrontLightX offset
  194.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  195.         0_UnicalNumberOfCorona += 1
  196.         0AC7: 0_VectorPointer = var 0_BackLightX offset
  197.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  198.         0_UnicalNumberOfCorona += 1
  199.     end
  200.     if or
  201.         0_LightsStatus == 1_Left
  202.         0_LightsStatus == 1_Both
  203.     then
  204.         0_BackLightX *= -1.0
  205.         0_FrontLightX *= -1.0
  206.         0AC7: 0_VectorPointer = var 0_FrontLightX offset
  207.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  208.         0_UnicalNumberOfCorona += 1
  209.         0AC7: 0_VectorPointer = var 0_BackLightX offset
  210.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  211.         0_UnicalNumberOfCorona += 1
  212.     end        
  213. else
  214.     0_LightsStatus = 0
  215.     0A8E: 0_NextPathPointID = 0_VehicleStruct + 0x3A6 // int   ????? ????????? ????? ????      0x3A6
  216.     0A8E: 0_CurrPathPointID = 0_VehicleStruct + 0x3A4 // int   ????? ??????? ????? ????         0x3A4
  217.     0A8E: 0_PrewPathPointID = 0_VehicleStruct + 0x3A8 // int   ????? ?????????? ????? ????     0x3A8
  218.     0A8D: 0_CurrPathPointID = read_memory 0_CurrPathPointID size 2 virtual_protect 0
  219.     0A8D: 0_NextPathPointID = read_memory 0_NextPathPointID size 2 virtual_protect 0
  220.     0A8D: 0_PrewPathPointID = read_memory 0_PrewPathPointID size 2 virtual_protect 0
  221.     if
  222.         0_CurrPathPointID <> 0xFFFF
  223.     then
  224.         for 31@ = 0 to 2
  225.             if
  226.                 3@(31@,3i) <> 0xFFFF
  227.             then    
  228.                 0085: 0_PointAdress = 3@(31@,3i) // (int)
  229.                
  230.                 0AC6: 30@ = label @SHR_0Ah offset
  231.                 0AA8: call_function_method 30@ struct 3@(31@,3i) num_params 0 pop 0 3@(31@,3i)
  232.              //   0B15: 3@(31@,3i) = 3@(31@,3i) SHR 0xA   ////////////////////////////////////////////////////////////
  233.              
  234.                 3@(31@,3i) *= 4
  235.                 3@(31@,3i) += 0x96F854
  236.                 0A8D: 3@(31@,3i) = read_memory 3@(31@,3i) size 4 virtual_protect 0
  237.                    
  238.                 if
  239.                     3@(31@,3i) <> 0
  240.                 then
  241.                     0085: 3@(31@,3i) = 0_PointAdress // (int)
  242.    
  243.                     0AC6: 30@ = label @AND_3FFh offset
  244.                     0AA8: call_function_method 30@ struct 0_PointAdress num_params 0 pop 0 0_PointAdress              
  245.                  //   0B10: 0_PointAdress = 0_PointAdress AND 0x3FF ///////////////////////////////////////////////////
  246.                    
  247.                     0_PointAdress *= 0xE
  248.                    
  249.                     0AC6: 30@ = label @SHR_0Ah offset
  250.                     0AA8: call_function_method 30@ struct 3@(31@,3i) num_params 0 pop 0 3@(31@,3i)                
  251.                   //  0B15: 3@(31@,3i) = 3@(31@,3i) SHR 0xA ///////////////////////////////////////////////////////////
  252.                    
  253.                     3@(31@,3i) *= 4
  254.                     3@(31@,3i) += 0x96F974
  255.                     0A8D: 3@(31@,3i) = read_memory 3@(31@,3i) size 4 virtual_protect 0
  256.                     005A: 0_PointAdress += 3@(31@,3i) // (int)
  257.                            
  258.                     0085: 6@(31@,3i) = 0_PointAdress // (int)
  259.                     0A8E: 9@(31@,3i) = 0_PointAdress + 2 // int
  260.                            
  261.                     0A8D: 6@(31@,3i) = read_memory 6@(31@,3i) size 2 virtual_protect 0
  262.                     if
  263.                         6@(31@,3i) >= 0x8000 // negative word
  264.                     then
  265.                         6@(31@,3i) += 0xFFFF0000 // convert to negative dword
  266.                     end
  267.                     0093: 6@(31@,3i) = integer 6@(31@,3i) to_float
  268.                     6@(31@,3f) /= 8.0
  269.                            
  270.                     0A8D: 9@(31@,3i) = read_memory 9@(31@,3i) size 2 virtual_protect 0
  271.                     if
  272.                         9@(31@,3i) >= 0x8000 // negative word
  273.                     then
  274.                         9@(31@,3i) += 0xFFFF0000 // convert to negative dword
  275.                     end
  276.                     0093: 9@(31@,3i) = integer 9@(31@,3i) to_float
  277.                     9@(31@,3f) /= 8.0  
  278.                 end
  279.             else
  280.                 6@(31@,3i) = 0.0
  281.                 9@(31@,3i) = 0.0
  282.             end // <> 0xFFFF          
  283.         end   // for end  
  284.    
  285.         0063: 0_NextX -= 0_CurrX // (float)
  286.         0063: 0_NextY -= 0_CurrY // (float)
  287.         0063: 0_CurrX -= 0_PrewX // (float)
  288.         0063: 0_CurrY -= 0_PrewY // (float)
  289.      
  290.         0604: get_Z_angle_for_point 0_NextX 0_NextY store_to 0_Angle1
  291.         0604: get_Z_angle_for_point 0_CurrX 0_CurrY store_to 0_Angle2
  292.         0063: 0_Angle1 -= 0_Angle2 // (float)
  293.         0656: get_angle 0_Angle1 absolute_degrees_to 0_Angle1
  294.         if and
  295.             0_Angle1 >= 30.0
  296.             0_Angle1 < 180.0
  297.         then
  298.             0_LightsStatus = 1_Left
  299.         else
  300.             if and
  301.                 0_Angle1 <= 330.0
  302.                 0_Angle1 > 180.0
  303.             then
  304.                 0_LightsStatus = 1_Right
  305.             else
  306.                 0_LightsStatus = 0
  307.             end
  308.         end   // LightsStatus
  309.         gosub @Get_lights_coords
  310.         if
  311.             0_LightsStatus == 1_Right
  312.         then
  313.             0AC7: 0_VectorPointer = var 0_FrontLightX offset
  314.             0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  315.             0_UnicalNumberOfCorona += 1
  316.             0AC7: 0_VectorPointer = var 0_BackLightX offset
  317.             0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  318.             0_UnicalNumberOfCorona += 1
  319.         end
  320.         if
  321.             0_LightsStatus == 1_Left
  322.         then
  323.             0_BackLightX *= -1.0
  324.             0_FrontLightX *= -1.0
  325.             0AC7: 0_VectorPointer = var 0_FrontLightX offset
  326.             0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  327.             0_UnicalNumberOfCorona += 1
  328.             0AC7: 0_VectorPointer = var 0_BackLightX offset
  329.             0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  330.             0_UnicalNumberOfCorona += 1
  331.         end        
  332.     end   // FFFF    3A4    
  333. end
  334.  
  335. 0_VehicleStruct += 0x4C8
  336. 0A8D: 0_VehicleStruct = read_memory 0_VehicleStruct size 4 virtual_protect 0
  337. if
  338.     0_VehicleStruct > 0
  339. then
  340.     gosub @Get_lights_coords
  341.     if or
  342.         0_LightsStatus == 1_Right
  343.         0_LightsStatus == 1_Both
  344.     then
  345.         0AC7: 0_VectorPointer = var 0_BackLightX offset
  346.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  347.         0_UnicalNumberOfCorona += 1
  348.     end
  349.     if or
  350.         0_LightsStatus == 1_Left
  351.         0_LightsStatus == 1_Both
  352.     then
  353.         0_BackLightX *= -1.0
  354.         0AC7: 0_VectorPointer = var 0_BackLightX offset
  355.         0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 50.0 0 penetration 0.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
  356.         0_UnicalNumberOfCorona += 1
  357.     end    
  358. end
  359.  
  360. return
  361.  
  362. :Get_lights_coords
  363. 0A8E: 0_Adress = 0_VehicleStruct + 0x22 // int
  364. 0A8D: 0_Adress = read_memory 0_Adress size 2 virtual_protect 0 //model index
  365. 0_Adress *= 4
  366. 0_Adress += 0xA9B0C8
  367. 0A8D: 0_Adress = read_memory 0_Adress size 4 virtual_protect 0 //CModel
  368. 0_Adress += 0x5C                                        
  369. 0A8D: 0_Adress = read_memory 0_Adress size 4 virtual_protect 0 //vehicle struct
  370. 0A8D: 0_FrontLightX = read_memory 0_Adress size 4 virtual_protect 0 //x offset
  371. 0_Adress += 4
  372. 0A8D: 0_FrontLightY = read_memory 0_Adress size 4 virtual_protect 0 //y offset
  373. 0_Adress += 4
  374. 0A8D: 0_FrontLightZ = read_memory 0_Adress size 4 virtual_protect 0 //z offset
  375. 0_Adress += 4
  376. 0A8D: 0_BackLightX = read_memory 0_Adress size 4 virtual_protect 0 //x offset
  377. 0_Adress += 4
  378. 0A8D: 0_BackLightY = read_memory 0_Adress size 4 virtual_protect 0 //y offset
  379. 0_Adress += 4
  380. 0A8D: 0_BackLightZ = read_memory 0_Adress size 4 virtual_protect 0 //z offset
  381. if
  382.     0_FrontLightX == 0.0
  383. then
  384.     0_FrontLightX = 0.15
  385. end
  386. if
  387.     0_BackLightX == 0.0
  388. then
  389.     0_BackLightX = 0.15
  390. end
  391. return
  392.  
  393. :SHR_0Ah
  394. hex
  395.     C1 E9 0A          // shr ecx, 0xA
  396.     89 C8             // mov eax, ecx
  397.     C3                // retn
  398. end
  399.  
  400. :AND_3FFh
  401. hex
  402.     81 E1 FF 03 00 00 // and ecx, 0x3FF
  403.     89 C8             // mov eax, ecx
  404.     C3                // retn
  405. end
  406. // 0AA5: 0x6FC580 21 21 1 0 attach_corona_flash_inertia 15.0 0 penetration 1.5 0 0 0 0 0 flare 0 type 0 range_of_visibility 150.0 radius 0.3 with_offsets 0_VectorPointer intensity 255 blue 0 green 128 red 255 to_physical 0_VehicleStruct unical_number 0_UnicalNumberOfCorona
Advertisement
Add Comment
Please, Sign In to add comment