RekZ Posted February 25, 2012 Posted February 25, 2012 este stream se escucha perfectamente pero no consigo que al apretar "M" la musica se para y no se cual es el error local streamURL = "http://dc162.4shared.com/img/1136148919/682088a1/dlink__2Fdownload_2FyLCwlhkI_3Ftsid_3D20120225-64913-6b58cda0/preview.mp3" function onResourceStart() sound = playSound(streamURL, true) end function toggleSong() if not songOff then setSoundVolume(song,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(song,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",togglesound) bindKey("m","down","music") Admin and Owner of the Pro Chile Community :3
Danii Posted February 25, 2012 Posted February 25, 2012 local streamURL = "http://dc162.4shared.com/img/1136148919/682088a1/dlink__2Fdownload_2FyLCwlhkI_3Ftsid_3D20120225-64913-6b58cda0/preview.mp3" function onResourceStart() sound = playSound(streamURL, true) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() end function toggleSong() if not songOff then setSoundVolume(sound,0) songOff = true removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundVolume(sound,1) songOff = false setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), onResourceStart) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",toggleSong) bindKey("m","down","music")
RekZ Posted February 25, 2012 Author Posted February 25, 2012 Gracias funciona perfectamente Admin and Owner of the Pro Chile Community :3
iFoReX Posted February 25, 2012 Posted February 25, 2012 me podrian ayudar ? quiero aser casi mismo pero que suenen canciones con la M y eso y de archivos que yo tengo en mi PC D: pero soy remalo en eso del audio en MTA ayudenme porfas elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Edikosh998 Posted February 25, 2012 Posted February 25, 2012 Eso depende como lo quieras, lo mas simple seria : bindKey("r","down", function() playSound("cancionQueQuierasPoner.mp3") end ) Esto tendria que arrancar, pero acordate que tenes que poner en el meta la cancion que quieras poner... Igual sugerencia, no pongas musica en tu server...ya que los usuarios que entran tendran que bajarlo y eso pesaria bastante. WRS( World Racing Server) [server] = 8%
iFoReX Posted February 25, 2012 Posted February 25, 2012 da = man en mi server ai q descargar 300 mb de puros mods de skins y autos buee y el meta seria asi verdad ? : <meta> <info author="ElMota" description="MiScriptDeMusic" version="1.3" type="script" /> <script src="Musica.lua" type="server" /> <file src="MiCancion.mp3" /> ? gracias por el script elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Castillo Posted February 25, 2012 Posted February 25, 2012 local streamURL = "http://dc162.4shared.com/img/1136148919/682088a1/dlink__2Fdownload_2FyLCwlhkI_3Ftsid_3D20120225-64913-6b58cda0/preview.mp3" function onResourceStart() sound = playSound(streamURL, true) end function toggleSong() if not isSoundPaused(song) then setSoundPaused(song, true) removeEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) else setSoundPaused(song, false) setRadioChannel(0) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) end end addEventHandler("onClientResourceStart",resourceRoot,onResourceStart) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("music",toggleSong) bindKey("m","down",toggleSong) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted February 25, 2012 Posted February 25, 2012 da = man en mi server ai q descargar 300 mb de puros mods de skins y autos buee y el meta seria asi verdad ? : <meta> <info author="ElMota" description="MiScriptDeMusic" version="1.3" type="script" /> <script src="Musica.lua" type="server" /> <file src="MiCancion.mp3" /> ? gracias por el script El meta es asi, si vos pones la cancion en la carpeta donde esta el script "Musica.lua". 300 mb de skins y autos xDD debes tener todos los autos modificados WRS( World Racing Server) [server] = 8%
Castillo Posted February 25, 2012 Posted February 25, 2012 No se que tiene quever los coches nuevos con este problema. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted February 25, 2012 Posted February 25, 2012 No se que tiene quever los coches nuevos con este problema. Es verdad, sory por el spam...igual me habia pedido lo de poner musica. Osea lo de los autos fue un comentario extra. WRS( World Racing Server) [server] = 8%
iFoReX Posted February 25, 2012 Posted February 25, 2012 tengo todo el f1 modificado con mas de 25 skins y mas de 30 autos y helis elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
Recommended Posts