huyjvguyen Posted November 26, 2015 Share Posted November 26, 2015 i created a browser , the video is active but its sound is very loud , go around the map are heard , I want to limit sound in a certain range so how . this is code: local screenWidth, screenHeight = guiGetScreenSize() local webBrowser = createBrowser(screenWidth, screenHeight, false, false) function webBrowserRender() dxDrawMaterialLine3D (1804.8203125, 795.5458984375, 15,1804.8203125, 795.5458984375, 11,webBrowser, 7, tocolor(255,255,255,255)) end addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "https://www.youtube.com/embed/w7gOcSps1OM?autoplay=1&iv_load_policy=3&enablejsapi=1&fs=0&theme=light") addEventHandler("onClientRender", root, webBrowserRender) end ) Link to comment
Best-Killer Posted November 26, 2015 Share Posted November 26, 2015 Use : https://wiki.multitheftauto.com/wiki/Se ... inDistance Link to comment
myonlake Posted November 26, 2015 Share Posted November 26, 2015 You can use https://wiki.multitheftauto.com/wiki/SetBrowserVolume to edit the volume of the browser. You can create a custom range that way. Link to comment
huyjvguyen Posted November 26, 2015 Author Share Posted November 26, 2015 You can use https://wiki.multitheftauto.com/wiki/SetBrowserVolume to edit the volume of the browser. You can create a custom range that way. this function not work. i was tried Link to comment
Castillo Posted November 26, 2015 Share Posted November 26, 2015 You could create a colshape where the video is being displayed, and set the volume to 0 when you exit this colshape. Or you could do as myonlake suggested and create a sound range system of your own. Link to comment
huyjvguyen Posted November 27, 2015 Author Share Posted November 27, 2015 You could create a colshape where the video is being displayed, and set the volume to 0 when you exit this colshape.Or you could do as Socialz suggested and create a sound range system of your own. can you make an example. Link to comment
Addlibs Posted November 27, 2015 Share Posted November 27, 2015 --Functions you can use addEventHandler onClientRender distance = getDistanceBetweenPoints3D setSoundVolume ( sound, 1 - (distance/300) ) -- 300m distance | smooth fadeout as you go away Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now