Advertisement
J16D

MP3 Player addon Shinobi World by J16D

Apr 27th, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. {
  2. MP3 player Addon Main.scm for Shinobi World
  3. https://www.youtube.com/watch?v=VnYEf9gFDGY
  4. by J16D
  5.  
  6. path mp3 files; GTA SA\Addon_NM\ambient_sounds
  7. mp3 files Names; MAX 10 char
  8. HOME - Play/Next
  9. END - Stop
  10. }
  11.  
  12. :AUDIO_BACK_MP3
  13. thread "AUDIO_BACK_MP3"
  14. wait $DEFAULT_WAIT_TIME
  15.  
  16. :activated
  17. while true
  18. if
  19. Player.Defined($PLAYER_CHAR)
  20. then
  21. repeat
  22. wait 0
  23. until 816B: not fading
  24. if and
  25. $ONMISSION == 0
  26. 0AB0: key_pressed 36 /// home
  27. then
  28. 0A99: chdir "Addon_NM\ambient_sounds"
  29. ///0AC8: 15@ = allocate_memory_size 260
  30. while true
  31. if
  32. 0AE6: 0@ = find_first_file "*.mp3" get_filename_to 15@v // IF and SET
  33. then
  34. :check_state
  35. 0AAC: 10@ = load_audiostream 15@v
  36. 0AAD: set_mp3 10@ perform_action 1
  37. 0ABC: set_audiostream 10@ volume 0.2
  38. {
  39. 0ADF: add_dynamic_GXT_entry "S_AMBI" text 15@v
  40. 0512: show_permanent_text_box 'S_AMBI'
  41. }
  42. while true
  43. 0AB9: get_mp3 10@ state_to 7@
  44. if
  45. not Player.Defined($PLAYER_CHAR)
  46. then
  47. break
  48. end
  49.  
  50. if or
  51. 0039: 7@ == -1
  52. 0AB0: key_pressed 36 /// home
  53. then
  54. if
  55. 0AE7: 15@v = find_next_file 0@ // IF and SET
  56. then
  57. 0AAD: set_mp3 10@ perform_action 0
  58. 0AAE: release_mp3 10@
  59. {
  60. 03E6: remove_text_box
  61. 0AE0: remove_dynamic_GXT_entry "S_AMBI"
  62. }
  63. wait 50
  64. jump @check_state
  65. else
  66. if
  67. 8AE7: not 15@v = find_next_file 0@ // IF and SET
  68. then
  69. 0AE8: find_close 0@
  70. break
  71. end
  72. end
  73. end
  74. if or
  75. $ONMISSION == 1
  76. 0AB0: key_pressed 35 /// end
  77. then
  78. jump @temporaly_desactivated
  79. end
  80. wait 0
  81. end
  82. 0AAD: set_mp3 10@ perform_action 0
  83. 0AAE: release_mp3 10@
  84. {
  85. 03E6: remove_text_box
  86. 0AE0: remove_dynamic_GXT_entry "S_AMBI"
  87. }
  88. end
  89. wait 250
  90. end
  91. end
  92. end
  93. wait 0
  94. end
  95. 004E: end_thread
  96.  
  97. :temporaly_desactivated
  98. 0A99: chdir 0
  99. ///0AC9: free_allocated_memory 15@
  100. 0AAD: set_mp3 10@ perform_action 0
  101. 0AAE: release_mp3 10@
  102. {
  103. 03E6: remove_text_box
  104. 0AE0: remove_dynamic_GXT_entry "S_AMBI"
  105. }
  106. wait 1000
  107. jump @activated
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement