OtaconEvil

[FUNCION] AudioStreamForALL By OTACON

Sep 8th, 2013
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.90 KB | None | 0 0
  1.     /*
  2.         * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  3.         *
  4.         * Estè Simple FUNCION esta hecho especialmente para www.forum.sa-mp.com
  5.         * NO Publicar estè FUNCION en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  6.         *
  7.         * Codigo Creado Por OTACON
  8.         *
  9.         * CREDITOS:
  10.         *     OTACON: Realizacion y Idea de creacion del code.
  11.         *     TÙ: Modificacion libremente respetando lo mencionado ;).
  12.         *
  13.         *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  14.         *
  15.         *            Prohibido TOTALMENTE el Robo de Créditos o la
  16.         *              Publicación de este FUNCION sin Mi Permiso.
  17.     */
  18.  
  19.     /*
  20.         * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  21.         *
  22.         * This simple FUNCTION is made especially for www.forum.sa-mp.com
  23.         * DO NOT Post the FUNCTION in Other SAMP forums and impersonating the creator of the CODE.
  24.         *
  25.         * Code Created By OTACON
  26.         *
  27.         * CREDITS:
  28.         *     OTACON: Idea Making and code creation.
  29.         *     YOUR: Modification freely respecting the above ;).
  30.         *
  31.         *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  32.         *
  33.         *                    FULLY spaces Theft Credit or
  34.         *             Publication of this MAP without my permission.
  35.     */
  36.  
  37. [CENTER][B][COLOR="DarkOrange"][SIZE="6"][] AudioStreamForALL[/SIZE][/COLOR][/B][/CENTER]
  38.  
  39. [COLOR="DarkOrchid"][B][SIZE="4"][] Informacio:[/SIZE][/B][/COLOR]
  40. [B][COLOR="DarkOrange"]es una simple funcion con la que puedes mandar un un audio a todos los usuarios que esten en el mismo interior y virtualworld que se encuentre el que coloca la funcion.[/COLOR][/B]
  41.  
  42. [COLOR="DarkOrchid"][B][SIZE="4"][] Native:[/SIZE][/B][/COLOR]
  43. [pawn]
  44. native PlayAudioStreamForALL(playerid, url[]);
  45. native StopAudioStreamForALL(playerid);
  46. [/pawn]
  47.  
  48. [COLOR="DarkOrchid"][B][SIZE="4"][] Funcion:[/SIZE][/B][/COLOR]
  49. [pawn]
  50. stock PlayAudioStreamForALL(playerid, url[]) {
  51.     //native PlayAudioStreamForALL(playerid, url[]);
  52.     if(IsPlayerConnected(playerid)) {
  53.         StopAudioStreamForPlayer(playerid);
  54.         PlayAudioStreamForPlayer(playerid, url);
  55.         for(new player, j = GetMaxPlayers(); player != j; player++) {
  56.             if(!IsPlayerConnected(player)) continue;
  57.             if(GetPlayerInterior(playerid) == GetPlayerInterior(player) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(player)) {
  58.                 if(IsPlayerConnected(player) && (player != playerid) && IsPlayerStreamedIn(playerid,player)) {
  59.                     StopAudioStreamForPlayer(player);
  60.                     PlayAudioStreamForPlayer(player, url);
  61.                 }
  62.             }
  63.         }
  64.     } return true;
  65. }
  66. stock StopAudioStreamForALL(playerid) {
  67.     //native StopAudioStreamForALL(playerid);
  68.     if(IsPlayerConnected(playerid)) {
  69.         StopAudioStreamForPlayer(playerid);
  70.         for(new player, j = GetMaxPlayers(); player != j; player++) {
  71.             if(!IsPlayerConnected(player)) continue;
  72.             if(GetPlayerInterior(playerid) == GetPlayerInterior(player) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(player)) {
  73.                 if(IsPlayerConnected(player) && (player != playerid) && IsPlayerStreamedIn(playerid,player)) {
  74.                     StopAudioStreamForPlayer(player);
  75.                 }
  76.             }
  77.         }
  78.     } return true;
  79. }
  80. [/pawn]
  81.  
  82. [COLOR="DarkOrchid"][B][SIZE="4"][] Ejemplo de Uso:[/SIZE][/B][/COLOR]
  83. [pawn]
  84. #include <a_samp>
  85. #include <zcmd>
  86.  
  87. COMMAND:audio(playerid, params[]) {
  88.     PlayAudioStreamForALL(playerid, "http://www.tu_sonico.com/audio.mp3");
  89.     return true;
  90. }
  91. COMMAND:parar(playerid, params[]) {
  92.     StopAudioStreamForALL(playerid);
  93.     return true;
  94. }
  95. [/pawn]
  96.  
  97. [COLOR="DarkOrchid"][B][SIZE="4"][] Creditos:[/SIZE][/B][/COLOR]
  98. [COLOR="DarkOrange"][B][SIZE="3"]OTACON[/SIZE][/B][/COLOR]
  99.  
  100.     /*
  101.         * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
  102.         *
  103.         * Estè Simple FUNCION esta hecho especialmente para www.forum.sa-mp.com
  104.         * NO Publicar estè FUNCION en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
  105.         *
  106.         * Codigo Creado Por OTACON
  107.         *
  108.         * CREDITOS:
  109.         *     OTACON: Realizacion y Idea de creacion del code.
  110.         *     TÙ: Modificacion libremente respetando lo mencionado ;).
  111.         *
  112.         *    NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
  113.         *
  114.         *            Prohibido TOTALMENTE el Robo de Créditos o la
  115.         *              Publicación de este FUNCION sin Mi Permiso.
  116.     */
  117.  
  118.     /*
  119.         * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
  120.         *
  121.         * This simple FUNCTION is made especially for www.forum.sa-mp.com
  122.         * DO NOT Post the FUNCTION in Other SAMP forums and impersonating the creator of the CODE.
  123.         *
  124.         * Code Created By OTACON
  125.         *
  126.         * CREDITS:
  127.         *     OTACON: Idea Making and code creation.
  128.         *     YOUR: Modification freely respecting the above ;).
  129.         *
  130.         *    NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
  131.         *
  132.         *                    FULLY spaces Theft Credit or
  133.         *             Publication of this MAP without my permission.
  134.     */
Add Comment
Please, Sign In to add comment