Jump to content

Help - set volume of Browser


Recommended Posts

Posted (edited)

Hello,

i just make TV system , but i got an error , how to set my youtube full screen not like this , and how to set the volume so if i near the tv only i can hear the volume , because i can hear it everywhere in this map

16arwvt.png

Edited by Guest
Posted (edited)

for the sound can you take the distance between your tv and player

example

function tvScreensound() 
    local x, y, z = getElementPosition(localPlayer) 
    local dist = getDistanceBetweenPoints3D(x,y ,z, 0, 0, 3) -- in 0, 0 ,3 put the location of your screen 
     if dist <= 100 then 
        setSoundVolume(file/soundname, 100) 
     end 
end 

Edited by Guest
Posted
function tvScreensound() 
    local x, y, z = getElementPosition(localPlayer) 
    local dist = getDistanceBetweenPoints3D(x,y ,z, 0, 0, 3) -- in 0, 0 ,3 put the location of your object where is your screen tv on.  
     if dist <= 100 then 
       setBrowserVolume(the browser, 1) 
     end  
end 

Posted

hmm , how to set the browser volume 0 first , because i can hear the volume everywhere .. i just try to setBrowserVolume(myBrowser, 0) but when i add distance volume , the volume still 0

Posted
function tvScreensound() 
    setBrowserVolume(myBrowser, 0.0) 
    local x, y, z = getElementPosition(localPlayer) 
    local dist = getDistanceBetweenPoints3D(x, y , z, 0, 0, 3) -- in 0, 0 ,3 put the location of your object where is your screen tv on. 
     if dist <= 100 then 
       setBrowserVolume(myBrowser, 1.0) 
     end 
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...