Jump to content

Problema con ambience_sound


Javier

Recommended Posts

Hola, tengo un problema con el resource ambience_sound de Yakuza. El problema es que se reproducen diferentes sonidos a los players. Es decir Yo escucho una de metal , mientras que otro player escucha otra. Yo quiero que todos escuchen la misma musica al mismo tiempo. Me yudan? Gracias

local sounds = {"--aca los links en este caso"} 
  
  
function playsound() 
  
 playSound(sounds[math.random(1, #sounds)]) 
 setSoundVolume(sound, 300.0) 
     
      
end 
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),playsound) 
  
setTimer(playsound, 410000,0) 
  

Link to comment
Pones ahi la URL que enviaste desde el servidor.

Lo hice asi

client

local sounds = {"las urls"} 
  
  
function playsound() 
  
 playSound(sounds[math.random(1, #sounds)]) 
 setSoundVolume(sound, 300.0) 
     
    
end 
addEvent("musica", true ) 
addEventHandler("musica",getResourceRootElement(getThisResource()),playsound) 
  
setTimer(playsound, 410000,0) 
  

server

function inicio () 
triggerClientEvent("musica", getRootElement(), playSound) 
end 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), inicio) 

Esta bien?

Link to comment

Esta vez lo hice yo, pero la proxima no.

-- client side:

addEvent ( "musica", true ) 
addEventHandler ( "musica", root, 
    function ( url ) 
        if ( isElement ( sound ) ) then 
            destroyElement ( sound ) 
        end 
        sound = playSound ( url ) 
        setSoundVolume ( sound, 300 ) 
    end 
) 

-- server side:

local sounds = { "las urls" } 
  
function inicio ( ) 
    triggerClientEvent ( "musica", getRootElement(), sounds [ math.random ( #sounds ) ] ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, inicio ) 
setTimer ( inicio, 410000, 0 ) 

Link to comment
Esta vez lo hice yo, pero la proxima no.

-- client side:

addEvent ( "musica", true ) 
addEventHandler ( "musica", root, 
    function ( url ) 
        if ( isElement ( sound ) ) then 
            destroyElement ( sound ) 
        end 
        sound = playSound ( url ) 
        setSoundVolume ( sound, 300 ) 
    end 
) 

-- server side:

local sounds = { "las urls" } 
  
function inicio ( ) 
    triggerClientEvent ( "musica", getRootElement(), sounds [ math.random ( #sounds ) ] ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, inicio ) 
setTimer ( inicio, 410000, 0 ) 

:) Ah Gracias.

Link to comment
  • Recently Browsing   0 members

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