Jump to content

¿ En que fallo ?


RekZ

Recommended Posts

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
    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

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

da = man en mi server ai q descargar 300 mb de puros mods de skins y autos :D

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" /> 

? :D gracias por el script

Link to comment
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
da = man en mi server ai q descargar 300 mb de puros mods de skins y autos :D

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" /> 

? :D 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 :D:D

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...