Guest User

Radio System Fixed By Allex

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