Jump to content

Problema con ambience_sound


Javier

Recommended Posts

Posted

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) 
  

Posted

Lo que podes hacer es cambiar para que envie las URL desde el server side a todos los jugadores, asi todos escucharian la misma cosa.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Lo que podes hacer es cambiar para que envie las URL desde el server side a todos los jugadores, asi todos escucharian la misma cosa.

Y como hago eso? :fadein:

Posted

Cambias parte del script que tenes, el que genera la cancion aleatoria, luego la envias a todos los jugadores con:

triggerClientEvent 

y ahi agregas ese evento en el client side con:

addEvent 
addEventHandler 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Pones ahi la URL que enviaste desde el servidor.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

Posted

Eso no tiene sentido.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

  • Recently Browsing   0 members

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