RekZ Posted February 25, 2012 Share 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") Link to comment
Danii Posted February 25, 2012 Share 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") Link to comment
RekZ Posted February 25, 2012 Author Share Posted February 25, 2012 Gracias funciona perfectamente Link to comment
iFoReX Posted February 25, 2012 Share 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 Link to comment
Edikosh998 Posted February 25, 2012 Share 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. Link to comment
iFoReX Posted February 25, 2012 Share 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 Link to comment
Castillo Posted February 25, 2012 Share 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) Link to comment
Edikosh998 Posted February 25, 2012 Share 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 Link to comment
Castillo Posted February 25, 2012 Share Posted February 25, 2012 No se que tiene quever los coches nuevos con este problema. Link to comment
Edikosh998 Posted February 25, 2012 Share 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. Link to comment
iFoReX Posted February 25, 2012 Share Posted February 25, 2012 tengo todo el f1 modificado con mas de 25 skins y mas de 30 autos y helis Link to comment
Recommended Posts