Advertisement
xt3z0ne

Simple Radio System

Dec 28th, 2014
333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 KB | None | 0 0
  1. /*
  2. ********************************************************************************
  3.  
  4. Radio System By JohnnyYz
  5. Credits JohnnyYz
  6. WebSite www.necro-zone.com | www.rss-ro.com
  7.  
  8. ********************************************************************************
  9. */
  10. //******************************************************************************
  11. #include " a_samp "
  12. #include " zcmd "
  13. #include " sscanf2 "
  14. //******************************************************************************
  15. new Text:TD_RADIO [ 10 ];
  16. //******************************************************************************
  17. public OnFilterScriptInit()
  18. {
  19. TD_RADIO [ 0 ] = TextDrawCreate(17.199996, 151.580001, "usebox");
  20. TextDrawLetterSize(TD_RADIO [ 0 ], 0.000000, 15.695188);
  21. TextDrawTextSize(TD_RADIO [ 0 ], 107.599899, 0.000000);
  22. TextDrawAlignment(TD_RADIO [ 0 ], 1);
  23. TextDrawColor(TD_RADIO [ 0 ], 0);
  24. TextDrawUseBox(TD_RADIO [ 0 ], true);
  25. TextDrawBoxColor(TD_RADIO [ 0 ], 102);
  26. TextDrawSetShadow(TD_RADIO [ 0 ], 0);
  27. TextDrawSetOutline(TD_RADIO [ 0 ], 0);
  28. TextDrawFont(TD_RADIO [ 0 ], 0);
  29. TextDrawSetPreviewModel(TD_RADIO [ 0 ], 9);
  30. TextDrawSetPreviewRot(TD_RADIO [ 0 ], 160.000000, 0.000000, 0.000000, 0.000000);
  31.  
  32. TD_RADIO [ 1 ] = TextDrawCreate(16.799995, 150.079971, "Radio");
  33. TextDrawLetterSize(TD_RADIO [ 1 ], 0.449999, 1.600000);
  34. TextDrawAlignment(TD_RADIO [ 1 ], 1);
  35. TextDrawColor(TD_RADIO [ 1 ], -65281);
  36. TextDrawUseBox(TD_RADIO [ 1 ], true);
  37. TextDrawBoxColor(TD_RADIO [ 1 ], 0);
  38. TextDrawSetShadow(TD_RADIO [ 1 ], 0);
  39. TextDrawSetOutline(TD_RADIO [ 1 ], 1);
  40. TextDrawBackgroundColor(TD_RADIO [ 1 ], 51);
  41. TextDrawFont(TD_RADIO [ 1 ], 0);
  42. TextDrawSetProportional(TD_RADIO [ 1 ], 1);
  43.  
  44. TD_RADIO [ 2 ] = TextDrawCreate(16.799989, 168.000000, "]]]]]]");
  45. TextDrawLetterSize(TD_RADIO [ 2 ], 0.449999, 1.600000);
  46. TextDrawTextSize(TD_RADIO [ 2 ], -228.800018, -111.253311);
  47. TextDrawAlignment(TD_RADIO [ 2 ], 1);
  48. TextDrawColor(TD_RADIO [ 2 ], 16711935);
  49. TextDrawUseBox(TD_RADIO [ 2 ], true);
  50. TextDrawBoxColor(TD_RADIO [ 2 ], 0);
  51. TextDrawSetShadow(TD_RADIO [ 2 ], 0);
  52. TextDrawSetOutline(TD_RADIO [ 2 ], 1);
  53. TextDrawBackgroundColor(TD_RADIO [ 2 ], 51);
  54. TextDrawFont(TD_RADIO [ 2 ], 0);
  55. TextDrawSetProportional(TD_RADIO [ 2 ], 1);
  56.  
  57. TD_RADIO [ 3 ] = TextDrawCreate(16.000032, 267.306854, "]]]]]]");
  58. TextDrawLetterSize(TD_RADIO [ 3 ], 0.449999, 1.600000);
  59. TextDrawAlignment(TD_RADIO [ 3 ], 1);
  60. TextDrawColor(TD_RADIO [ 3 ], 16711935);
  61. TextDrawSetShadow(TD_RADIO [ 3 ], 0);
  62. TextDrawSetOutline(TD_RADIO [ 3 ], 1);
  63. TextDrawBackgroundColor(TD_RADIO [ 3 ], 51);
  64. TextDrawFont(TD_RADIO [ 3 ], 2);
  65. TextDrawSetProportional(TD_RADIO [ 3 ], 1);
  66.  
  67. TD_RADIO [ 4 ] = TextDrawCreate(17.599998, 280.000183, "Necro-Zone");
  68. TextDrawLetterSize(TD_RADIO [ 4 ], 0.449999, 1.600000);
  69. TextDrawTextSize(TD_RADIO [ 4 ], -66.399688, -113.493576);
  70. TextDrawAlignment(TD_RADIO [ 4 ], 1);
  71. TextDrawColor(TD_RADIO [ 4 ], -65281);
  72. TextDrawUseBox(TD_RADIO [ 4 ], true);
  73. TextDrawBoxColor(TD_RADIO [ 4 ], 0);
  74. TextDrawSetShadow(TD_RADIO [ 4 ], 0);
  75. TextDrawSetOutline(TD_RADIO [ 4 ], 1);
  76. TextDrawBackgroundColor(TD_RADIO [ 4 ], 51);
  77. TextDrawFont(TD_RADIO [ 4 ], 0);
  78. TextDrawSetProportional(TD_RADIO [ 4 ], 1);
  79.  
  80. TD_RADIO [ 5 ] = TextDrawCreate(31.199972, 186.666687, "KISS FM");
  81. TextDrawLetterSize(TD_RADIO [ 5 ], 0.449999, 1.600000);
  82. TextDrawTextSize(TD_RADIO [ 5 ], -116.000022, -39.573329);
  83. TextDrawAlignment(TD_RADIO [ 5 ], 1);
  84. TextDrawColor(TD_RADIO [ 5 ], -1);
  85. TextDrawSetShadow(TD_RADIO [ 5 ], 0);
  86. TextDrawSetOutline(TD_RADIO [ 5 ], 1);
  87. TextDrawBackgroundColor(TD_RADIO [ 5 ], 51);
  88. TextDrawFont(TD_RADIO [ 5 ], 1);
  89. TextDrawSetProportional(TD_RADIO [ 5 ], 1);
  90.  
  91. TD_RADIO [ 6 ] = TextDrawCreate(30.399982, 201.599899, "Radio FM");
  92. TextDrawLetterSize(TD_RADIO [ 6 ], 0.449999, 1.600000);
  93. TextDrawAlignment(TD_RADIO [ 6 ], 1);
  94. TextDrawColor(TD_RADIO [ 6 ], -1);
  95. TextDrawSetShadow(TD_RADIO [ 6 ], 0);
  96. TextDrawSetOutline(TD_RADIO [ 6 ], 1);
  97. TextDrawBackgroundColor(TD_RADIO [ 6 ], 51);
  98. TextDrawFont(TD_RADIO [ 6 ], 1);
  99. TextDrawSetProportional(TD_RADIO [ 6 ], 1);
  100.  
  101. TD_RADIO [ 7 ] = TextDrawCreate(29.599994, 218.026565, "GDD");
  102. TextDrawLetterSize(TD_RADIO [ 7 ], 0.449999, 1.600000);
  103. TextDrawAlignment(TD_RADIO [ 7 ], 1);
  104. TextDrawColor(TD_RADIO [ 7 ], -1);
  105. TextDrawSetShadow(TD_RADIO [ 7 ], 0);
  106. TextDrawSetOutline(TD_RADIO [ 7 ], 1);
  107. TextDrawBackgroundColor(TD_RADIO [ 7 ], 51);
  108. TextDrawFont(TD_RADIO [ 7 ], 1);
  109. TextDrawSetProportional(TD_RADIO [ 7 ], 1);
  110.  
  111. TD_RADIO [ 8 ] = TextDrawCreate(30.399700, 235.199890, "RadioWISH");
  112. TextDrawLetterSize(TD_RADIO [ 8 ], 0.449999, 1.600000);
  113. TextDrawAlignment(TD_RADIO [ 8 ], 1);
  114. TextDrawColor(TD_RADIO [ 8 ], -1);
  115. TextDrawSetShadow(TD_RADIO [ 8 ], 0);
  116. TextDrawSetOutline(TD_RADIO [ 8 ], 1);
  117. TextDrawBackgroundColor(TD_RADIO [ 8 ], 51);
  118. TextDrawFont(TD_RADIO [ 8 ], 1);
  119. TextDrawSetProportional(TD_RADIO [ 8 ], 1);
  120. //==============================================================================
  121. TextDrawSetSelectable(TD_RADIO [ 5 ], false);
  122. TextDrawSetSelectable(TD_RADIO [ 6 ], true);
  123. TextDrawSetSelectable(TD_RADIO [ 7 ], true);
  124. TextDrawSetSelectable(TD_RADIO [ 8 ], true);
  125. return 1;
  126. }
  127. public OnFilterScriptExit()
  128. {
  129. TextDrawDestroy(TD_RADIO [ 0 ]);
  130. TextDrawDestroy(TD_RADIO [ 1 ]);
  131. TextDrawDestroy(TD_RADIO [ 2 ]);
  132. TextDrawDestroy(TD_RADIO [ 3 ]);
  133. TextDrawDestroy(TD_RADIO [ 4 ]);
  134. TextDrawDestroy(TD_RADIO [ 5 ]);
  135. TextDrawDestroy(TD_RADIO [ 6 ]);
  136. TextDrawDestroy(TD_RADIO [ 7 ]);
  137. TextDrawDestroy(TD_RADIO [ 8 ]);
  138. return 1;
  139. }
  140. //******************************************************************************
  141. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  142. {
  143. if(_:clickedid != 65535)
  144. {
  145. if(clickedid == TD_RADIO [ 6 ])
  146. {
  147. HideRadio( playerid );
  148. PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
  149.  
  150. }
  151. if(clickedid == TD_RADIO [ 7 ])
  152. {
  153. HideRadio( playerid );
  154. PlayAudioStreamForPlayer(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u");
  155.  
  156. }
  157. if(clickedid == TD_RADIO [ 8 ])
  158. {
  159. HideRadio( playerid );
  160. PlayAudioStreamForPlayer(playerid, "http://www.radiowish.ro/live.m3u");
  161.  
  162. }
  163. }
  164. return 1;
  165. }
  166. //******************************************************************************
  167. COMMAND:radio(playerid, params[])
  168. {
  169. ShowRadio( playerid );
  170. return 1;
  171. }
  172. //******************************************************************************
  173. stock ShowRadio( playerid )
  174. {
  175. TextDrawShowForPlayer(playerid,TD_RADIO [ 0 ]);
  176. TextDrawShowForPlayer(playerid,TD_RADIO [ 1 ]);
  177. TextDrawShowForPlayer(playerid,TD_RADIO [ 2 ]);
  178. TextDrawShowForPlayer(playerid,TD_RADIO [ 3 ]);
  179. TextDrawShowForPlayer(playerid,TD_RADIO [ 4 ]);
  180. TextDrawShowForPlayer(playerid,TD_RADIO [ 6 ]);
  181. TextDrawShowForPlayer(playerid,TD_RADIO [ 7 ]);
  182. TextDrawShowForPlayer(playerid,TD_RADIO [ 8 ]);
  183. //******************************************************************************
  184. SelectTextDraw(playerid, 0xFF0000FF);
  185. return 1;
  186. }
  187. //******************************************************************************
  188. stock HideRadio( playerid )
  189. {
  190. TextDrawHideForPlayer(playerid,TD_RADIO [ 0 ]);
  191. TextDrawHideForPlayer(playerid,TD_RADIO [ 1 ]);
  192. TextDrawHideForPlayer(playerid,TD_RADIO [ 2 ]);
  193. TextDrawHideForPlayer(playerid,TD_RADIO [ 3 ]);
  194. TextDrawHideForPlayer(playerid,TD_RADIO [ 4 ]);
  195. TextDrawHideForPlayer(playerid,TD_RADIO [ 6 ]);
  196. TextDrawHideForPlayer(playerid,TD_RADIO [ 7 ]);
  197. TextDrawHideForPlayer(playerid,TD_RADIO [ 8 ]);
  198. CancelSelectTextDraw(playerid);
  199. return 1;
  200. }
  201. /*
  202. ********************************************************************************
  203.  
  204. Radio System By JohnnyYz
  205. Credits JohnnyYz
  206. WebSite www.necro-zone.com | www.rss-ro.com
  207.  
  208. ********************************************************************************
  209. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement