Guest User

Radio System Fixed By Allex

a guest
Apr 10th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.69 KB | None | 0 0
  1. #if defined CREDITS
  2.  
  3. Salut ! Vad ca esti incepator .
  4. ________________________________________________________________________________
  5. Aici iti voi explica functii de mai jos :
  6. ________________________________________________________________________________
  7. switch( dialogid ) - l-am folosit mai jos deoarece da o rapiditate dialogului .
  8. ________________________________________________________________________________
  9. switch - se foloseste de exemplu :
  10. ________________________________________________________________________________
  11. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  12. {
  13. switch( dialogid )
  14. {
  15. case DIALOG_RADIO:
  16. {
  17. if(response)
  18. {
  19. switch( listitem )
  20. {
  21. case 0: SencClientMessage( playerid , -1 , "Bine ai venit la un mic tutorial !" );
  22. case 1: SendClientMessage( playerid , -1 , "Aici iti voi explica niste functii ");
  23. }
  24. }
  25. return 1;
  26. }
  27. return 0;
  28. }
  29. ________________________________________________________________________________
  30. strcat - se foloseste de obicei cand vrei sa scrii ceva .
  31. ________________________________________________________________________________
  32. new
  33. string[ 1200 ];
  34. ________________________________________________________________________________
  35. strcat( string , sizeof string, "Sper ca ai inteles ceva pana acum din acest mini tutorial\n", 1200 );
  36. ________________________________________________________________________________
  37. PlayAudioStreamForPlayer - porneste muzica pentru un player xD
  38. ________________________________________________________________________________
  39. PlayAudioStreamForPlayer( playerid , "link.mp3" );
  40. ________________________________________________________________________________
  41. SendClientMessage - trimite unui player un mesaj
  42. ________________________________________________________________________________
  43. SendClientMessage( playerid , -1 , "Welcome To The Server Mr" );
  44. ________________________________________________________________________________
  45. SendClientMessageToAll - trimite tuturor playerilor un mesaj dar si in consola
  46. ________________________________________________________________________________
  47. SendClientMessageToAll( playerid , -1 , "Ownerul acestui radio sistem este necunoscut" );
  48. ________________________________________________________________________________
  49. GetPlayerName - este functia care verifica numele unui player , mai precis il ia
  50. ________________________________________________________________________________
  51. new
  52. Name[ MAX_PLAYER_NAME ],
  53. ________________________________________________________________________________
  54. Str[ 256 ];
  55. ________________________________________________________________________________
  56. GetPlayerName( playerid , Name , sizeof Name );
  57. ________________________________________________________________________________
  58. format( , sizeof Str, "%s a intrat pe serverul nostru", Name );
  59. ________________________________________________________________________________
  60. SendClientMessageToAll( playerid , -1 , Str );
  61. ________________________________________________________________________________
  62. Daca nu vrei sa faci mereu cu GetPlayerName foloseste asa :
  63. ________________________________________________________________________________
  64. stock GetName( playerid )
  65. {
  66. ________________________________________________________________________________
  67. new
  68. Name[ MAX_PLAYER_NAME ];
  69. ________________________________________________________________________________
  70. GetPlayerName( playerid , Name , sizeof Name );
  71. ________________________________________________________________________________
  72. return Name;
  73. }
  74. ________________________________________________________________________________
  75. Stock - iti permite sa folosesti dor o linie / cuvant pentru a lua numele in cazul nostru nu sa mai creezi inca un new cum am facut mai sus si sa te folosesti de functia GetPlayerName .
  76. ________________________________________________________________________________
  77. Contact :
  78. ________________________________________________________________________________
  79.  
  80. #endif
  81. //=====================================//
  82. #include <a_samp>
  83. #include <zcmd>
  84. //=====================================//
  85. #define DIALOG_RADIO 2012
  86. //=====================================//
  87. new
  88. string[256],
  89. pName[MAX_PLAYER_NAME];
  90.  
  91. public OnFilterScriptInit()
  92. {
  93. print("\n--------------------------------------");
  94. print("Radio Filterscript!");
  95. print("--------------------------------------\n");
  96. return 1;
  97. }
  98.  
  99. CMD:rmusic(playerid, params[])
  100. {
  101. new
  102. vehicleid = GetPlayerVehicleID( vehicleid );
  103.  
  104. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  105. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  106.  
  107. if( IsPlayerInVehicle( playerid, vehicleid ) )
  108. {
  109. new sradio[1900];
  110. strcat(sradio, "{FFFFFF}Radio Sensation \t\t\t \n", 1900 );
  111. strcat(sradio, "{FFFFFF}Radio HiT FM \t\t\t \n", 1900 );
  112. strcat(sradio, "{FFFFFF}Radio Lautarii \t\t\t \n", 1900 );
  113. strcat(sradio, "{FFFFFF}Radio Romanian Hip-Hop \t \n", 1900 );
  114. strcat(sradio, "{FFFFFF}Radio Romanian Manele \t \n", 1900 );
  115. strcat(sradio, "{FFFFFF}Radio Romanian Popular \t \n", 1900 );
  116. strcat(sradio, "{FFFFFF}Pro FM \t\t\t\t \n", 1900 );
  117. strcat(sradio, "{FFFFFF}Radio HotStyle \t\t \n", 1900 );
  118. strcat(sradio, "{FFFFFF}Radio Vip \t\t \n", 1900 );
  119. strcat(sradio, "{FFFFFF}Radio Mafia \t\t\t \n", 1900 );
  120. strcat(sradio, "{FFFFFF}Radio Greu de Difuzat \t\t \n", 1900 );
  121. strcat(sradio, "{FF0000}Opreste radioul \t\t ", 1900 );
  122. ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, " Meniu Radio", sradio, "Selecteaza", "");
  123. }
  124. return 1;
  125. }
  126.  
  127. CMD:radiohit(playerid)
  128. {
  129. new
  130. vehicleid = GetPlayerVehicleID( vehicleid );
  131.  
  132. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  133. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  134.  
  135. if( IsPlayerInVehicle( playerid, vehicleid ) )
  136. {
  137. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  138. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  139. SendClientMessageToAll(0xFFFFFFAA,string);
  140. PlayAudioStreamForPlayer(playerid, "http://www.radio-hit.ro/asculta.m3u");
  141. }
  142. return 1;
  143. }
  144.  
  145. CMD:radiowish(playerid)
  146. {
  147. new
  148. vehicleid = GetPlayerVehicleID( vehicleid );
  149.  
  150. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  151. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  152.  
  153. if( IsPlayerInVehicle( playerid, vehicleid ) )
  154. {
  155. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  156. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  157. SendClientMessageToAll(0xFFFFFFAA,string);
  158. PlayAudioStreamForPlayer(playerid, "http://www.radiosensation.ro/live.m3u");
  159. }
  160. return 1;
  161. }
  162.  
  163. CMD:contactfm(playerid)
  164. {
  165. new
  166. vehicleid = GetPlayerVehicleID( vehicleid );
  167.  
  168. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  169. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  170.  
  171. if( IsPlayerInVehicle( playerid, vehicleid ) )
  172. {
  173. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  174. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  175. SendClientMessageToAll(0xFFFFFFAA,string);
  176. PlayAudioStreamForPlayer(playerid, "http://live.radiolautaru.ro:9000/");
  177. }
  178. return 1;
  179. }
  180.  
  181. CMD:romanianhiphop(playerid)
  182. {
  183. new
  184. vehicleid = GetPlayerVehicleID( vehicleid );
  185.  
  186. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  187. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  188.  
  189. if( IsPlayerInVehicle( playerid, vehicleid ) )
  190. {
  191. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  192. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  193. SendClientMessageToAll(0xFFFFFFAA,string);
  194. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/hiphop.pls");
  195. }
  196. return 1;
  197. }
  198.  
  199. CMD:romanianpopular(playerid)
  200. {
  201. new
  202. vehicleid = GetPlayerVehicleID( vehicleid );
  203.  
  204. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  205. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  206.  
  207. if( IsPlayerInVehicle( playerid, vehicleid ) )
  208. {
  209. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  210. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  211. SendClientMessageToAll(0xFFFFFFAA,string);
  212. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/popular.pls");
  213. }
  214. return 1;
  215. }
  216.  
  217. CMD:romanianmanele(playerid)
  218. {
  219. new
  220. vehicleid = GetPlayerVehicleID( vehicleid );
  221.  
  222. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  223. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  224.  
  225. if( IsPlayerInVehicle( playerid, vehicleid ) )
  226. {
  227. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  228. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  229. SendClientMessageToAll(0xFFFFFFAA,string);
  230. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/manele.pls");
  231. }
  232. return 1;
  233. }
  234.  
  235. CMD:profm(playerid)
  236. {
  237. new
  238. vehicleid = GetPlayerVehicleID( vehicleid );
  239.  
  240. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  241. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  242.  
  243. if( IsPlayerInVehicle( playerid, vehicleid ) )
  244. {
  245. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  246. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  247. SendClientMessageToAll(0xFFFFFFAA,string);
  248. PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
  249. }
  250. return 1;
  251. }
  252.  
  253. CMD:gmusic(playerid)
  254. {
  255. new
  256. vehicleid = GetPlayerVehicleID( vehicleid );
  257.  
  258. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  259. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  260.  
  261. if( IsPlayerInVehicle( playerid, vehicleid ) )
  262. {
  263. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  264. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  265. SendClientMessageToAll(0xFFFFFFAA,string);
  266. PlayAudioStreamForPlayer(playerid, "http://www.radiohotstyle.ro/listen.m3u");
  267. }
  268. return 1;
  269. }
  270.  
  271. CMD:radiotube(playerid)
  272. {
  273. new
  274. vehicleid = GetPlayerVehicleID( vehicleid );
  275.  
  276. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  277. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  278.  
  279. if( IsPlayerInVehicle( playerid, vehicleid ) )
  280. {
  281. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  282. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  283. SendClientMessageToAll(0xFFFFFFAA,string);
  284. PlayAudioStreamForPlayer(playerid, "http://radiovip.ro/live.m3u");
  285. }
  286. return 1;
  287. }
  288.  
  289. CMD:radiomafia(playerid)
  290. {
  291. new
  292. vehicleid = GetPlayerVehicleID( vehicleid );
  293.  
  294. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  295. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  296.  
  297. if( IsPlayerInVehicle( playerid, vehicleid ) )
  298. {
  299. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  300. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  301. SendClientMessageToAll(0xFFFFFFAA,string);
  302. PlayAudioStreamForPlayer(playerid, "http://www.radiomafia.ro/listen.m3u");
  303. }
  304. return 1;
  305. }
  306.  
  307. CMD:greudedifuzat(playerid)
  308. {
  309. new
  310. vehicleid = GetPlayerVehicleID( vehicleid );
  311.  
  312. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  313. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  314.  
  315. if( IsPlayerInVehicle( playerid, vehicleid ) )
  316. {
  317. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  318. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  319. SendClientMessageToAll(0xFFFFFFAA,string);
  320. PlayAudioStreamForPlayer(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u");
  321. }
  322. return 1;
  323. }
  324.  
  325. CMD:stopradio(playerid)
  326. {
  327. new
  328. vehicleid = GetPlayerVehicleID( vehicleid );
  329.  
  330. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  331. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  332.  
  333. if( IsPlayerInVehicle( playerid, vehicleid ) )
  334. {
  335. StopAudioStreamForPlayer(playerid);
  336. }
  337. return 1;
  338. }
  339.  
  340. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  341. {
  342. if( dialogid == DIALOG_RADIO )
  343. {
  344. if(response)
  345. {
  346. switch(listitem)
  347. {
  348. case 0: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiohit" );
  349. case 1: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/contactfm" );
  350. case 2: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianhiphop" );
  351. case 3: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianmanele" );
  352. case 4: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianpopular" );
  353. case 5: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/profm" );
  354. case 6: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/gmusic" );
  355. case 7: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiotube" );
  356. case 8: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiomafia" );
  357. case 9: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/greudedifuzat" );
  358. case 10: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/stopradio" );
  359. }
  360. }
  361. }
  362. return 1;
  363. }
Advertisement
Add Comment
Please, Sign In to add comment