Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$CLEO}
- 0000:
- repeat
- wait 50
- until 0AFA: is_samp_available
- while true
- wait 0
- if
- 0AB1: @GET_TARGET_ACTOR 0 0@
- then
- 0AB1: call_scm_func @Get_relative_observable_velocity 2 victim 0@ suspect $PLAYER_ACTOR _ret_velocity 1@
- chatmsg "rel_sid_vel=%.0f" -1 1@
- end
- end
- :Get_relative_observable_velocity
- 0AB1: call_scm_func @Get_actor_relative_speed_XYZ 2 main_actor(victim) 0@ actor_to_compare(suspect) 1@ _XYZ_velocity 29@ 30@ 31@ // without this function it would cause false warning if suspect and victim were surfing, + would show warning if suspect was surfing and victim standing
- 04C4: store_coords_to 26@ 27@ 28@ from_actor 1@ with_offset 0.0 0.0 0.0
- 04C4: store_coords_to 23@ 24@ 25@ from_actor 0@ with_offset 0.0 0.0 0.0
- 0AB1: @getAngleBetweenPoints 4 from_XY 26@ 27@ and_XY 23@ 24@ store_to 22@ // pos_angle between suspect and victim
- 0604: get_Z_angle_for_point 29@ 30@ store_to 21@ // victim direction of movement (angle)
- //chatmsg "pos_angle=%.0f his_mov_dir_angle=%.0f" -1 22@ 21@
- 0063: 22@ -= 21@ // (float) //pos_angle - dir of movement
- if 22@ < 0.0
- then
- 22@ += 360.0
- end
- 02F6: 22@ = sine 22@ // (float)
- 0097: make 29@ absolute_float
- 0097: make 30@ absolute_float
- 0097: make 31@ absolute_float
- 0097: make 22@ absolute_float
- 005B: 29@ += 30@ // (float) added x+y speed
- 006B: 29@ *= 22@ // (float) multiplied by sine of pos_angle modified by dir_mov_angle
- 005B: 29@ += 31@ // (float) added vertical (z) speed (not affected by toward/outward movement so it's just added at the end)
- 0AB2: 1 29@
- :Get_actor_relative_speed_XYZ
- if 0449: actor 0@ in_a_car
- then
- 25@ = Actor.CurrentCar(0@)
- 06A2: get_car 25@ velocity_in_direction_XYZ 29@ 30@ 31@
- else
- 083D: get_actor 0@ velocity_in_direction_XYZ 29@ 30@ 31@
- end
- if 0449: actor 1@ in_a_car
- then
- 24@ = Actor.CurrentCar(1@)
- 06A2: get_car 24@ velocity_in_direction_XYZ 26@ 27@ 28@
- else
- 083D: get_actor 1@ velocity_in_direction_XYZ 26@ 27@ 28@
- end
- 0063: 29@ -= 26@
- 0063: 30@ -= 27@
- 0063: 31@ -= 28@
- 0AB2: 3 29@ 30@ 31@
- :getAngleBetweenPoints
- 0063: 0@ -= 2@
- 0063: 1@ -= 3@
- 0604: get_Z_angle_for_point 0@ 1@ store_to 31@
- 0AB2: 1 31@
- //http://ugbase.eu/Thread-SNIPPET-GET-TARGET-ACTOR
- //by Opcode.eXe
- :GET_TARGET_ACTOR
- 28@ = 640.0
- 0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
- 000A: 29@ += 0x4
- 0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
- for 30@ = 0 to 35584 step 0x100
- 0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
- 000A: 29@ += 0x1
- if and
- 0029: 31@ >= 0x00
- 001B: 0x80 > 31@
- then
- 005A: 31@ += 30@
- if
- 056D: actor 31@ defined
- then
- if
- 803C: $PLAYER_ACTOR == 31@ // (int)
- then
- 04C4: store_coords_to 27@ 26@ 25@ from_actor 31@ with_offset 0.0 0.0 0.0
- 068D: get_camera_position_to 24@ 23@ 22@
- if and
- 02CB: actor 31@ bounding_sphere_visible
- 06BD: no_obstacles_between 27@ 26@ 25@ and 24@ 23@ 22@ solid 1 car 0 actor 0 object 1 particle 0
- then
- 0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 27@ Y 26@ Z 25@ store_screen_X_to 24@ Y_to 23@
- 0509: 22@ = distance_between_XY 339.0 179.0 and_XY 24@ 23@
- if
- 0035: 28@ >= 22@ // (float)
- then
- 0087: 28@ = 22@ // (float)
- 0087: 15@ = 31@ // (float)
- end
- end
- end
- end
- end
- end
- if
- 056D: actor 15@ defined
- then
- 0485: return_true
- else
- 059A: return_false
- end
- 0AB2: 1 15@
- //0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
- :getScreenXYFrom3DCoords
- 0AC7: 14@ = var 0@ offset
- 0AC7: 15@ = var 3@ offset
- 0AC7: 16@ = var 6@ offset
- 0AC7: 17@ = var 9@ offset
- 0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
- 0007: 12@ = 640.0
- 0007: 13@ = 448.0
- 0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
- 0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
- 0093: 14@ = integer 14@ to_float
- 0093: 15@ = integer 15@ to_float
- 0073: 12@ /= 14@
- 0073: 13@ /= 15@
- 006B: 3@ *= 12@
- 006B: 4@ *= 13@
- 0AB2: ret 2 3@ 4@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement