Advertisement
J16D

$ Include example - catch Peds/Cars

Apr 4th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. {
  2. example_catch_peds with $include command by DK22Pac
  3.  
  4. read more:
  5. http://gtaforums.com/topic/503390-useful-using-of-include
  6. }
  7.  
  8.  
  9. {$CLEO}
  10. 0000:
  11.  
  12. {$I inloop}
  13. if
  14. Player.Defined(0)
  15. then
  16. if and
  17. 0AB0: key_pressed 20 // caps lock
  18. 0AB0: key_pressed 32 // spacebar
  19. then
  20. 0ACA: show_text_box "fun time"
  21. 32@ = 0 // set timer = 0 seconds
  22.  
  23. while 7000 > 32@ /// while 7 seconds are still not passed.
  24. /// FOR PEDS
  25. {$I forallpeds}
  26. if and
  27. 056D: actor ped defined
  28. 803C: not $PLAYER_ACTOR == ped // (int) /// found an actor!
  29. then
  30. 00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
  31. 00A0: store_actor ped position_to 3@ 4@ 5@
  32. 050A: 6@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 3@ 4@ 5@
  33. if
  34. 5.0 > 6@ /// if distance between $player & the found_actor is less than 5.0
  35. then
  36. 0326: 20@ = create_actor ped fire /// yeea! burn! lol // do something with found_actor
  37. break
  38. end
  39. end
  40. {$I for_end}
  41.  
  42. /// FOR CARS
  43. {$I forallcars}
  44. if
  45. 056E: car veh defined /// found a car!
  46. then
  47. 00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
  48. 00AA: store_car veh position_to 3@ 4@ 5@
  49. 050A: 6@ = distance_between_XYZ 0@ 1@ 2@ and_XYZ 3@ 4@ 5@
  50. if
  51. 7.0 > 6@ /// if distance between $player & the found_car is less than 7.0
  52. then
  53. 070C: explode_car veh // versionB /// yeea! burn! lol /// do something with found_car
  54. break
  55. end
  56. end
  57. {$I for_end}
  58. wait 0
  59. end
  60.  
  61. 0ACA: show_text_box "fun over"
  62. end
  63. end
  64. {$I end}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement