Arsilex Posted December 20, 2011 Posted December 20, 2011 tengo una pregunta es posible acer que en un mapa de race dm al principio suene una cancion y despues que el canal 1 de la radio se apague con un marker y se encienda el canal dos sonando otra cancion???
Arsilex Posted December 20, 2011 Author Posted December 20, 2011 function startMusic() setRadioChannel(0) song = playSound("files/song.ogg",true) outputChatBox("Press M to break the ambiance") setSoundVolume(song, 0) end function musicvol() setSoundVolume(song, 1) end function makeRadioStayOff() setRadioChannel(0) cancelEvent() 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()),startMusic) addEventHandler("onClientMarkerHit", markermusic, musicvol) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) addCommandHandler("musicmusic",toggleSong) bindKey("m","down","musicmusic") function CreateMarker ( playerSource ) if ( playerSource ) then local x, y, z = getElementPosition ( playerSource ) music marker = createMarker ( -1645, -188, 14.14396572113, "checkpoint", 2, 255, 0, 0, 255 ) addEventHandler("onMarkerHit", marker, MarkerHit) function music marker() sound = playSound( "music.mp3", true ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), startMySound ) function stopMySound() stopSound( sound ) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEventHandler("onClientMarkerHit", markermusic, musica) addEventHandler("onClientPlayerRadioSwitch",getRootElement(),makeRadioStayOff) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),makeRadioStayOff) ASi???????????
Castillo Posted December 20, 2011 Posted December 20, 2011 No veo en 'onClientMapStarting' en ningun lugar.
diegofkda Posted December 20, 2011 Posted December 20, 2011 function startingPlayingSound() channel1 = playSound ( "channel1.mp3" ) setTimer ( changeChannel, 10000, 1 ) --después de 10 segundos ir a la función changeChannel. end addEventHandler ( "onClientMapStarting", root, startPlayingSound ) function changeChannel() destroyElement ( channel1 ) playSound ( "channel2.mp3" ) end Lo que hace es hacer sonar el archivo "channel.mp3" primero, y después de 10 segundos poner el otro y destruir el 1.
Recommended Posts