Jump to content

Sound played


browneyadz

Recommended Posts

Posted

Server

function bridgeMusic(thePlayer) 
  triggerClientEvent(getRootElement(), "bridgeCloseMusic", getRootElement()) 
end 
addCommandHandler("bridgeclose", bridgeMusic) 

Client

addEvent("bridgeCloseMusic",true) 
addEventHandler("bridgeCloseMusic", getRootElement(), function() 
local sound = playSound3D("music.mp3", x, y, z, false)   
setSoundVolume(sound, 2.0) 
end) 

  • Discord Moderators
Posted
setSoundVolume is 0.0 - 1.0 not above 1.

it doesnt really matter ... :roll:

well at some point it does.. the sound volume is max by default anyways

Posted

mta lua is rather idiot-proof (it doesnt mean i think you are one, just a general calling), but on some more advanced languages - setting values over the max will broke whole code :P

the sound volume is max by default anyways 

im always wondering why everyone using playSound or playSound3D are setting volume to default value. never seen anybody here (asking for help) NOT doing this.. hmm, maybe example on wiki have this?

  • Discord Moderators
Posted

The example on wiki playSound sets the volume to 0.5.

People probably acknowledge you need to set the audio volume before you can hear it

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