Jump to content

Set song volume of maps?


Recommended Posts

Posted

Hi, i have a dude and its how to set the volume to 50% or less to play another sounds, and when that sound is finished. stop playing it and set the map music to 100 again, any one could help me?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

  • 4 weeks later...
Posted

so if it will be like this...??

local gMap = exports.mapmanager:getRunningGamemodeMap() 
local mapRoot = getResourceRootElement(gMap) 
theSound = getElementsByType("sound", mapRoot) 
  
setSoundVolume(theSound, 0.5) 

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted
so if it will be like this...??
local gMap = exports.mapmanager:getRunningGamemodeMap() 
local mapRoot = getResourceRootElement(gMap) 
theSound = getElementsByType("sound", mapRoot) 
  
setSoundVolume(theSound, 0.5) 

Almost. :P

local gMap = exports.mapmanager:getRunningGamemodeMap() 
local mapRoot = getResourceRootElement(gMap) 
theSounds = getElementsByType("sound", mapRoot) 
for placeNumber,sound in ipairs(theSounds) do 
     setSoundVolume(theSound, 0.5) 
end 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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