Advertisement
Guest User

Radio System Fixed By Allex

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