Advertisement
Guest User

Radio System Fixed By Allex

a guest
Apr 10th, 2013
46
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. Y!M: alex_toja13@yahoo.com
  79. Gmail: alex13.dumi@gmail.com
  80. ________________________________________________________________________________
  81.  
  82. #endif
  83. //=====================================//
  84. #include <a_samp>
  85. #include <zcmd>
  86. //=====================================//
  87. #define DIALOG_RADIO 2012
  88. //=====================================//
  89. new
  90. string[256],
  91. pName[MAX_PLAYER_NAME];
  92.  
  93. public OnFilterScriptInit()
  94. {
  95. print("\n--------------------------------------");
  96. print("Radio Filterscript!");
  97. print("--------------------------------------\n");
  98. return 1;
  99. }
  100.  
  101. CMD:rmusic(playerid, params[])
  102. {
  103. new
  104. vehicleid = GetPlayerVehicleID( vehicleid );
  105.  
  106. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  107. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  108.  
  109. if( IsPlayerInVehicle( playerid, vehicleid ) )
  110. {
  111. new sradio[1900];
  112. strcat(sradio, "{FFFFFF}Radio Sensation \t\t\t \n", 1900 );
  113. strcat(sradio, "{FFFFFF}Radio HiT FM \t\t\t \n", 1900 );
  114. strcat(sradio, "{FFFFFF}Radio Lautarii \t\t\t \n", 1900 );
  115. strcat(sradio, "{FFFFFF}Radio Romanian Hip-Hop \t \n", 1900 );
  116. strcat(sradio, "{FFFFFF}Radio Romanian Manele \t \n", 1900 );
  117. strcat(sradio, "{FFFFFF}Radio Romanian Popular \t \n", 1900 );
  118. strcat(sradio, "{FFFFFF}Pro FM \t\t\t\t \n", 1900 );
  119. strcat(sradio, "{FFFFFF}Radio HotStyle \t\t \n", 1900 );
  120. strcat(sradio, "{FFFFFF}Radio Vip \t\t \n", 1900 );
  121. strcat(sradio, "{FFFFFF}Radio Mafia \t\t\t \n", 1900 );
  122. strcat(sradio, "{FFFFFF}Radio Greu de Difuzat \t\t \n", 1900 );
  123. strcat(sradio, "{FF0000}Opreste radioul \t\t ", 1900 );
  124. ShowPlayerDialog(playerid, DIALOG_RADIO, DIALOG_STYLE_LIST, " Meniu Radio", sradio, "Selecteaza", "");
  125. }
  126. return 1;
  127. }
  128.  
  129. CMD:radiohit(playerid)
  130. {
  131. new
  132. vehicleid = GetPlayerVehicleID( vehicleid );
  133.  
  134. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  135. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  136.  
  137. if( IsPlayerInVehicle( playerid, vehicleid ) )
  138. {
  139. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  140. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  141. SendClientMessageToAll(0xFFFFFFAA,string);
  142. PlayAudioStreamForPlayer(playerid, "http://www.radio-hit.ro/asculta.m3u");
  143. }
  144. return 1;
  145. }
  146.  
  147. CMD:radiowish(playerid)
  148. {
  149. new
  150. vehicleid = GetPlayerVehicleID( vehicleid );
  151.  
  152. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  153. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  154.  
  155. if( IsPlayerInVehicle( playerid, vehicleid ) )
  156. {
  157. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  158. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  159. SendClientMessageToAll(0xFFFFFFAA,string);
  160. PlayAudioStreamForPlayer(playerid, "http://www.radiosensation.ro/live.m3u");
  161. }
  162. return 1;
  163. }
  164.  
  165. CMD:contactfm(playerid)
  166. {
  167. new
  168. vehicleid = GetPlayerVehicleID( vehicleid );
  169.  
  170. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  171. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  172.  
  173. if( IsPlayerInVehicle( playerid, vehicleid ) )
  174. {
  175. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  176. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  177. SendClientMessageToAll(0xFFFFFFAA,string);
  178. PlayAudioStreamForPlayer(playerid, "http://live.radiolautaru.ro:9000/");
  179. }
  180. return 1;
  181. }
  182.  
  183. CMD:romanianhiphop(playerid)
  184. {
  185. new
  186. vehicleid = GetPlayerVehicleID( vehicleid );
  187.  
  188. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  189. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  190.  
  191. if( IsPlayerInVehicle( playerid, vehicleid ) )
  192. {
  193. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  194. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  195. SendClientMessageToAll(0xFFFFFFAA,string);
  196. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/hiphop.pls");
  197. }
  198. return 1;
  199. }
  200.  
  201. CMD:romanianpopular(playerid)
  202. {
  203. new
  204. vehicleid = GetPlayerVehicleID( vehicleid );
  205.  
  206. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  207. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  208.  
  209. if( IsPlayerInVehicle( playerid, vehicleid ) )
  210. {
  211. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  212. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  213. SendClientMessageToAll(0xFFFFFFAA,string);
  214. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/popular.pls");
  215. }
  216. return 1;
  217. }
  218.  
  219. CMD:romanianmanele(playerid)
  220. {
  221. new
  222. vehicleid = GetPlayerVehicleID( vehicleid );
  223.  
  224. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  225. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  226.  
  227. if( IsPlayerInVehicle( playerid, vehicleid ) )
  228. {
  229. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  230. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  231. SendClientMessageToAll(0xFFFFFFAA,string);
  232. PlayAudioStreamForPlayer(playerid, "http://radioromanian.net/manele.pls");
  233. }
  234. return 1;
  235. }
  236.  
  237. CMD:profm(playerid)
  238. {
  239. new
  240. vehicleid = GetPlayerVehicleID( vehicleid );
  241.  
  242. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  243. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  244.  
  245. if( IsPlayerInVehicle( playerid, vehicleid ) )
  246. {
  247. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  248. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  249. SendClientMessageToAll(0xFFFFFFAA,string);
  250. PlayAudioStreamForPlayer(playerid, "http://stream.profm.ro:8012/profm.mp3");
  251. }
  252. return 1;
  253. }
  254.  
  255. CMD:gmusic(playerid)
  256. {
  257. new
  258. vehicleid = GetPlayerVehicleID( vehicleid );
  259.  
  260. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  261. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  262.  
  263. if( IsPlayerInVehicle( playerid, vehicleid ) )
  264. {
  265. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  266. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  267. SendClientMessageToAll(0xFFFFFFAA,string);
  268. PlayAudioStreamForPlayer(playerid, "http://www.radiohotstyle.ro/listen.m3u");
  269. }
  270. return 1;
  271. }
  272.  
  273. CMD:radiotube(playerid)
  274. {
  275. new
  276. vehicleid = GetPlayerVehicleID( vehicleid );
  277.  
  278. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  279. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  280.  
  281. if( IsPlayerInVehicle( playerid, vehicleid ) )
  282. {
  283. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  284. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  285. SendClientMessageToAll(0xFFFFFFAA,string);
  286. PlayAudioStreamForPlayer(playerid, "http://radiovip.ro/live.m3u");
  287. }
  288. return 1;
  289. }
  290.  
  291. CMD:radiomafia(playerid)
  292. {
  293. new
  294. vehicleid = GetPlayerVehicleID( vehicleid );
  295.  
  296. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  297. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  298.  
  299. if( IsPlayerInVehicle( playerid, vehicleid ) )
  300. {
  301. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  302. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  303. SendClientMessageToAll(0xFFFFFFAA,string);
  304. PlayAudioStreamForPlayer(playerid, "http://www.radiomafia.ro/listen.m3u");
  305. }
  306. return 1;
  307. }
  308.  
  309. CMD:greudedifuzat(playerid)
  310. {
  311. new
  312. vehicleid = GetPlayerVehicleID( vehicleid );
  313.  
  314. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  315. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  316.  
  317. if( IsPlayerInVehicle( playerid, vehicleid ) )
  318. {
  319. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  320. format( string , sizeof ( string ) , "%s asculta radio ! ", pName );
  321. SendClientMessageToAll(0xFFFFFFAA,string);
  322. PlayAudioStreamForPlayer(playerid, "http://www.greudedifuzat.eu/greudedifuzat.m3u");
  323. }
  324. return 1;
  325. }
  326.  
  327. CMD:stopradio(playerid)
  328. {
  329. new
  330. vehicleid = GetPlayerVehicleID( vehicleid );
  331.  
  332. if( !IsPlayerInVehicle( playerid, vehicleid ) )
  333. return SendClientMessage( playerid , -1 ,"Nu esti in masina pentru a asculta radio" );
  334.  
  335. if( IsPlayerInVehicle( playerid, vehicleid ) )
  336. {
  337. StopAudioStreamForPlayer(playerid);
  338. }
  339. return 1;
  340. }
  341.  
  342. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  343. {
  344. if( dialogid == DIALOG_RADIO )
  345. {
  346. if(response)
  347. {
  348. switch(listitem)
  349. {
  350. case 0: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiohit" );
  351. case 1: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/contactfm" );
  352. case 2: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianhiphop" );
  353. case 3: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianmanele" );
  354. case 4: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/romanianpopular" );
  355. case 5: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/profm" );
  356. case 6: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/gmusic" );
  357. case 7: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiotube" );
  358. case 8: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/radiomafia" );
  359. case 9: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/greudedifuzat" );
  360. case 10: CallRemoteFunction( "OnPlayerCommandText", "is", playerid, "/stopradio" );
  361. }
  362. }
  363. }
  364. return 1;
  365. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement