Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //- EXAMPLE
- {
- Draw a 2D line between 3D points
- by J16D
- }
- while true
- if 00E1: player 0 pressed_key 6 /// ~k~~PED_LOCK_TARGET~
- then
- //- here put a code to get PED
- if 056D: actor 20@ defined
- then
- 00A0: store_actor 20@ position_to 7@ 8@ 9@
- 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ -> store_to 7@ 8@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 1@ 2@ 3@ -> store_to 1@ 2@
- 0AB1: @DRAW_LINE 9 POS 1@ 2@ _TO_ 7@ 8@ RGBA 255 255 255 255 THICKNESS 0.5
- end
- //- here put a code to get CAR
- if 056E: car 20@ defined
- then
- 00AA: store_car 20@ position_to 7@ 8@ 9@
- 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ -> store_to 7@ 8@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 1@ 2@ 3@ -> store_to 1@ 2@
- 0AB1: @DRAW_LINE 9 POS 1@ 2@ _TO_ 7@ 8@ RGBA 255 255 255 255 THICKNESS 0.5
- end
- //- here put a code to get OBJECT
- if 03CA: object 20@ exists
- then
- 01BB: store_object 20@ position_to 7@ 8@ 9@
- 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 7@ 8@ 9@ -> store_to 7@ 8@
- 0AB1: @getScreenXYFrom3DCoords 3 coords_XYZ 1@ 2@ 3@ -> store_to 1@ 2@
- 0AB1: @DRAW_LINE 9 POS 1@ 2@ _TO_ 7@ 8@ RGBA 255 255 255 255 THICKNESS 0.5
- end
- end
- wait 0
- end
- //-+-- CALL SCM helpers
- :DRAW_LINE
- //0AB1: @DRAW_LINE 9 POS 10.0 10.0 _TO_ 200.0 310.0 RGBA 255 0 0 255 THICKNESS 1.0
- 0087: 11@ = 2@ // (float)
- 0087: 12@ = 3@ // (float)
- 0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@
- 10@ -= 37.0 {REMOVE STRANGE OFFSET AT END}
- 0063: 2@ -= 0@ // (float)
- 0063: 3@ -= 1@ // (float)
- 0604: get_Z_angle_for_point 2@ 3@ store_to 9@
- 9@ += 84.0
- 005B: 0@ += 11@
- 0@ /= 2.0 {MITTE} // get center pos
- 005B: 1@ += 12@
- 1@ /= 2.0
- 03F0: enable_text_draw 1
- 074B: draw_texture 666 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@
- 0AB2: ret 0
- :getScreenXYFrom3DCoords
- ////0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
- 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