Advertisement
Carlitos_SAMP

Radio System

Feb 6th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.50 KB | None | 0 0
  1. //==============================================================================
  2. #include <a_samp>
  3. #include <YSI\y_commands>
  4. #define SIVA 0xAFAFAFAA
  5. //==============================================================================
  6. new PlayerText:RadioTD0;
  7. new PlayerText:RadioTD1;
  8. new PlayerText:RadioTD2;
  9. new PlayerText:RadioTD3;
  10. new PlayerText:RadioTD4;
  11. new PlayerText:RadioTD5;
  12. new PlayerText:RadioTD6;
  13. new PlayerText:RadioTD7;
  14. //==============================================================================
  15. new RadioStanica[MAX_PLAYERS];
  16. new PrikazanRadio[MAX_PLAYERS];
  17. //==============================================================================
  18. public OnFilterScriptInit()
  19. {
  20. return 1;
  21. }
  22. public OnFilterScriptExit()
  23. {
  24. return 1;
  25. }
  26. //==============================================================================
  27. public OnPlayerConnect(playerid)
  28. {
  29. RadioStanica[playerid] = 0; PrikazanRadio[playerid] = 0;
  30. //====================================================================
  31. RadioTD0 = CreatePlayerTextDraw(playerid,429.000000, 100.000000, "_");
  32. PlayerTextDrawBackgroundColor(playerid,RadioTD0, 255);
  33. PlayerTextDrawFont(playerid,RadioTD0, 1);
  34. PlayerTextDrawLetterSize(playerid,RadioTD0, 1.000000, 7.800000);
  35. PlayerTextDrawColor(playerid,RadioTD0, -1);
  36. PlayerTextDrawSetOutline(playerid,RadioTD0, 0);
  37. PlayerTextDrawSetProportional(playerid,RadioTD0, 1);
  38. PlayerTextDrawSetShadow(playerid,RadioTD0, 1);
  39. PlayerTextDrawUseBox(playerid,RadioTD0, 1);
  40. PlayerTextDrawBoxColor(playerid,RadioTD0, 4227272);
  41. PlayerTextDrawTextSize(playerid,RadioTD0, 199.000000, 0.000000);
  42.  
  43. RadioTD1 = CreatePlayerTextDraw(playerid,425.000000, 103.000000, "__");
  44. PlayerTextDrawBackgroundColor(playerid,RadioTD1, 255);
  45. PlayerTextDrawFont(playerid,RadioTD1, 1);
  46. PlayerTextDrawLetterSize(playerid,RadioTD1, 0.500000, 7.099997);
  47. PlayerTextDrawColor(playerid,RadioTD1, -1);
  48. PlayerTextDrawSetOutline(playerid,RadioTD1, 0);
  49. PlayerTextDrawSetProportional(playerid,RadioTD1, 1);
  50. PlayerTextDrawSetShadow(playerid,RadioTD1, 1);
  51. PlayerTextDrawUseBox(playerid,RadioTD1, 1);
  52. PlayerTextDrawBoxColor(playerid,RadioTD1, 255);
  53. PlayerTextDrawTextSize(playerid,RadioTD1, 203.000000, 0.000000);
  54.  
  55. RadioTD2 = CreatePlayerTextDraw(playerid,401.000000, 110.000000, "____");
  56. PlayerTextDrawBackgroundColor(playerid,RadioTD2, 0);
  57. PlayerTextDrawFont(playerid,RadioTD2, 1);
  58. PlayerTextDrawLetterSize(playerid,RadioTD2, 0.500000, 1.000000);
  59. PlayerTextDrawColor(playerid,RadioTD2, -1);
  60. PlayerTextDrawSetOutline(playerid,RadioTD2, 0);
  61. PlayerTextDrawSetProportional(playerid,RadioTD2, 1);
  62. PlayerTextDrawSetShadow(playerid,RadioTD2, 1);
  63. PlayerTextDrawUseBox(playerid,RadioTD2, 1);
  64. PlayerTextDrawBoxColor(playerid,RadioTD2, 4227272);
  65. PlayerTextDrawTextSize(playerid,RadioTD2, 230.000000, 0.000000);
  66.  
  67. RadioTD3 = CreatePlayerTextDraw(playerid,314.000000, 109.000000, "Cool Radio");
  68. PlayerTextDrawAlignment(playerid,RadioTD3, 2);
  69. PlayerTextDrawBackgroundColor(playerid,RadioTD3, 255);
  70. PlayerTextDrawFont(playerid,RadioTD3, 2);
  71. PlayerTextDrawLetterSize(playerid,RadioTD3, 0.319999, 1.000000);
  72. PlayerTextDrawColor(playerid,RadioTD3, -1);
  73. PlayerTextDrawSetOutline(playerid,RadioTD3, 1);
  74. PlayerTextDrawSetProportional(playerid,RadioTD3, 1);
  75.  
  76. RadioTD4 = CreatePlayerTextDraw(playerid,254.000000, 86.000000, "RadioModel");
  77. PlayerTextDrawBackgroundColor(playerid,RadioTD4, 0);
  78. PlayerTextDrawFont(playerid,RadioTD4, 5);
  79. PlayerTextDrawLetterSize(playerid,RadioTD4, 0.500000, 1.000000);
  80. PlayerTextDrawColor(playerid,RadioTD4, -1);
  81. PlayerTextDrawSetOutline(playerid,RadioTD4, 0);
  82. PlayerTextDrawSetProportional(playerid,RadioTD4, 1);
  83. PlayerTextDrawSetShadow(playerid,RadioTD4, 1);
  84. PlayerTextDrawUseBox(playerid,RadioTD4, 1);
  85. PlayerTextDrawBoxColor(playerid,RadioTD4, 255);
  86. PlayerTextDrawTextSize(playerid,RadioTD4, 104.000000, 112.000000);
  87. PlayerTextDrawSetPreviewModel(playerid, RadioTD4, 19612);
  88. PlayerTextDrawSetPreviewRot(playerid, RadioTD4, 0.000000, 0.000000, -20.000000, 1.000000);
  89.  
  90.  
  91. RadioTD5 = CreatePlayerTextDraw(playerid,219.000000, 115.000000, "Nazad");
  92. PlayerTextDrawBackgroundColor(playerid,RadioTD5, 0);
  93. PlayerTextDrawFont(playerid,RadioTD5, 5);
  94. PlayerTextDrawLetterSize(playerid,RadioTD5, 0.500000, 1.000000);
  95. PlayerTextDrawColor(playerid,RadioTD5, -1);
  96. PlayerTextDrawSetOutline(playerid,RadioTD5, 0);
  97. PlayerTextDrawSetProportional(playerid,RadioTD5, 1);
  98. PlayerTextDrawSetShadow(playerid,RadioTD5, 1);
  99. PlayerTextDrawUseBox(playerid,RadioTD5, 1);
  100. PlayerTextDrawBoxColor(playerid,RadioTD5, 255);
  101. PlayerTextDrawTextSize(playerid,RadioTD5, 47.000000, 66.000000);
  102. PlayerTextDrawSetPreviewModel(playerid, RadioTD5, 19130);
  103. PlayerTextDrawSetPreviewRot(playerid, RadioTD5, 0.000000, -90.000000, 100.000000, 1.000000);
  104. PlayerTextDrawSetSelectable(playerid,RadioTD5, 1);
  105.  
  106. RadioTD6 = CreatePlayerTextDraw(playerid,365.000000, 115.000000, "Napred");
  107. PlayerTextDrawBackgroundColor(playerid,RadioTD6, 0);
  108. PlayerTextDrawFont(playerid,RadioTD6, 5);
  109. PlayerTextDrawLetterSize(playerid,RadioTD6, 0.500000, 1.000000);
  110. PlayerTextDrawColor(playerid,RadioTD6, -1);
  111. PlayerTextDrawSetOutline(playerid,RadioTD6, 0);
  112. PlayerTextDrawSetProportional(playerid,RadioTD6, 1);
  113. PlayerTextDrawSetShadow(playerid,RadioTD6, 1);
  114. PlayerTextDrawUseBox(playerid,RadioTD6, 1);
  115. PlayerTextDrawBoxColor(playerid,RadioTD6, 255);
  116. PlayerTextDrawTextSize(playerid,RadioTD6, 47.000000, 66.000000);
  117. PlayerTextDrawSetPreviewModel(playerid, RadioTD6, 19130);
  118. PlayerTextDrawSetPreviewRot(playerid, RadioTD6, 0.000000, 90.000000, 100.000000, 1.000000);
  119. PlayerTextDrawSetSelectable(playerid,RadioTD6, 1);
  120.  
  121. RadioTD7 = CreatePlayerTextDraw(playerid,267.000000, 155.000000, "/turnoff /stopmusic");
  122. PlayerTextDrawBackgroundColor(playerid,RadioTD7, 255);
  123. PlayerTextDrawFont(playerid,RadioTD7, 2);
  124. PlayerTextDrawLetterSize(playerid,RadioTD7, 0.200000, 1.000000);
  125. PlayerTextDrawColor(playerid,RadioTD7, -1);
  126. PlayerTextDrawSetOutline(playerid,RadioTD7, 1);
  127. PlayerTextDrawSetProportional(playerid,RadioTD7, 1);
  128. return 1;
  129. }
  130. //==============================================================================
  131. public OnPlayerDisconnect(playerid, reason)
  132. {
  133. RadioStanica[playerid] = 0; PrikazanRadio[playerid] = 0;
  134. return 1;
  135. }
  136. //==============================================================================
  137. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  138. {
  139. return 1;
  140. }
  141. //==============================================================================
  142. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
  143. {
  144. if(playertextid == RadioTD6)
  145. {
  146. if(RadioStanica[playerid] == 1)
  147. {
  148. RadioStanica[playerid] = 2;
  149. PlayAudioStreamForPlayer(playerid, "http://89.205.127.244:8002");
  150. PlayerTextDrawSetString(playerid, RadioTD3,"Folk Radio");
  151. }
  152. else if(RadioStanica[playerid] == 2)
  153. {
  154. RadioStanica[playerid] = 3;
  155. PlayAudioStreamForPlayer(playerid, "http://pink.exyuserver.com/listen.pls");
  156. PlayerTextDrawSetString(playerid, RadioTD3,"Pink Radio");
  157. }
  158. else if(RadioStanica[playerid] == 3)
  159. {
  160. RadioStanica[playerid] = 4;
  161. PlayAudioStreamForPlayer(playerid, "http://balkan.dj.topstream.net:8070");
  162. PlayerTextDrawSetString(playerid, RadioTD3,"Balkan DJ Radio");
  163. }
  164. else if(RadioStanica[playerid] == 4)
  165. {
  166. RadioStanica[playerid] = 5;
  167. PlayAudioStreamForPlayer(playerid, "http://rtvmerak.com:8003");
  168. PlayerTextDrawSetString(playerid, RadioTD3,"Juzni Vetar Radio");
  169. }
  170. else if(RadioStanica[playerid] == 5)
  171. {
  172. RadioStanica[playerid] = 1;
  173. PlayAudioStreamForPlayer(playerid,"http://www.coolradio.rs/download/playlist.pls");
  174. PlayerTextDrawSetString(playerid, RadioTD3,"Cool Radio");
  175. }
  176. }
  177. if(playertextid == RadioTD5)
  178. {
  179. if(RadioStanica[playerid] == 1)
  180. {
  181. RadioStanica[playerid] = 5;
  182. PlayAudioStreamForPlayer(playerid, "http://rtvmerak.com:8003");
  183. PlayerTextDrawSetString(playerid, RadioTD3,"Juzni Vetar Radio");
  184. }
  185. else if(RadioStanica[playerid] == 2)
  186. {
  187. RadioStanica[playerid] = 1;
  188. PlayAudioStreamForPlayer(playerid, "http://www.coolradio.rs/download/playlist.pls");
  189. PlayerTextDrawSetString(playerid, RadioTD3,"Cool Radio");
  190. }
  191. else if(RadioStanica[playerid] == 3)
  192. {
  193. RadioStanica[playerid] = 2;
  194. PlayAudioStreamForPlayer(playerid, "http://89.205.127.244:8002");
  195. PlayerTextDrawSetString(playerid, RadioTD3,"Folk Radio");
  196. }
  197. else if(RadioStanica[playerid] == 4)
  198. {
  199. RadioStanica[playerid] = 3;
  200. PlayAudioStreamForPlayer(playerid, "http://pink.exyuserver.com/listen.pls");
  201. PlayerTextDrawSetString(playerid, RadioTD3,"Pink Radio");
  202. }
  203. else if(RadioStanica[playerid] == 5)
  204. {
  205. RadioStanica[playerid] = 4;
  206. PlayAudioStreamForPlayer(playerid,"http://balkan.dj.topstream.net:8070");
  207. PlayerTextDrawSetString(playerid, RadioTD3,"Balkan DJ Radio");
  208. }
  209. }
  210. return 1;
  211. }
  212. //==============================================================================
  213. //=================== KOMANDE ==========================
  214. YCMD:radio(playerid,params[],help)
  215. {
  216. if(PrikazanRadio[playerid] == 1) return SendClientMessage(playerid,-1,"Vec vam je prikazan radio!");
  217. PlayerTextDrawShow(playerid, RadioTD0); PlayerTextDrawShow(playerid, RadioTD1); PlayerTextDrawShow(playerid, RadioTD2); PlayerTextDrawShow(playerid, RadioTD3);
  218. PlayerTextDrawShow(playerid, RadioTD4); PlayerTextDrawShow(playerid, RadioTD5); PlayerTextDrawShow(playerid, RadioTD6); PlayerTextDrawShow(playerid, RadioTD7);
  219. RadioStanica[playerid] = 1;
  220. PrikazanRadio[playerid] = 1;
  221. PlayAudioStreamForPlayer(playerid, "http://www.coolradio.rs/download/playlist.pls");
  222. SelectTextDraw(playerid,-1);
  223. return 1;
  224. }
  225. //==============================================================================
  226. YCMD:turnoff(playerid,params[],help)
  227. {
  228. if(PrikazanRadio[playerid] == 0) return SendClientMessage(playerid,-1,"Nije vam prikazan radio!");
  229. PlayerTextDrawHide(playerid, RadioTD0); PlayerTextDrawHide(playerid, RadioTD1); PlayerTextDrawHide(playerid, RadioTD2); PlayerTextDrawHide(playerid, RadioTD3);
  230. PlayerTextDrawHide(playerid, RadioTD4); PlayerTextDrawHide(playerid, RadioTD5); PlayerTextDrawHide(playerid, RadioTD6); PlayerTextDrawHide(playerid, RadioTD7);
  231. CancelSelectTextDraw(playerid); PrikazanRadio[playerid] = 0;
  232. return 1;
  233. }
  234. //==============================================================================
  235. YCMD:stopmusic(playerid, params[],help)
  236. {
  237. #pragma unused help
  238. StopAudioStreamForPlayer(playerid);
  239. return 1;
  240. }
  241. //==================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement