Jump to content

no suena la musica ni da problema al debug


iFoReX

Recommended Posts

no da ni problema ni nada. :P

lo Que queria que pasara era que al poner el cmd /play LINK nombre , era que se reproduciera el LINK, y en el outputchatbox apareciiera Reproduciendo : nombre :3 nose si me entienden

aqui el script :

cl-side

  
addEvent("triggear",true) 
addEventHandler("triggear",root, 
function(cancion,nombre) 
    setRadioChannel(0) 
    song = playSound(cancion,true) 
    outputChatBox("#48FF00##2E2E2EReproduciendo : #48FF00##2E2E2"..nombre,root,0,0,0,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 
addCommandHandler("music",toggleSong) 

sv-side

addCommandHandler("play",function(playerSource,commandName,cancion,nombre) 
for k,v in ipairs(players) do 
accountname = getAccountName (getPlayerAccount(v)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "admin" ) ) then 
triggerClientEvent("triggear",playerSource,cancion,nombre) 
end 
end 
end 
) 
  

Link to comment

ya arregle todo ... y asi me quedo

--------------------- 
---Script Echo por ElMota----- 
--------------------- 
  
  
addEvent("triggear",true) 
addEventHandler("triggear",root, 
function(cancion,nombre) 
    setRadioChannel(0) 
    stopSound(song) 
    setTimer(function() song = playSound(cancion,true) end,2000,1) 
    outputChatBox(" #48FF00##2E2E2EReproduciendo : #48FF00##2E2E2E"..nombre,0,0,0,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 
addCommandHandler("music",toggleSong) 

addCommandHandler("play",function(playerSource,commandName,cancion,nombre) 
for k,v in ipairs(getElementsByType"player") do 
accountname = getAccountName (getPlayerAccount(v)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
triggerClientEvent("triggear",playerSource,cancion,nombre) 
end 
end 
end 
) 
  

tengo 1 problema, en mi server local funciona a la perfeccion, pero en el server hosteado se reproduce 2 veces a la vez la misma cancion :C

Link to comment

Me parecia ami, pero bueh.

addCommandHandler ( "play", 
    function ( playerSource, commandName, cancion, nombre ) 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( "Admin" ) ) then 
            triggerClientEvent ( root, "triggear", root, cancion, nombre ) 
        end 
    end 
) 

Link to comment
  • Recently Browsing   0 members

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