browneyadz Posted October 21, 2010 Posted October 21, 2010 Hello, Me and Minibrowney recently made a bridgetoll script. https://community.multitheftauto.com/index.php?p= ... ls&id=1128 We was wondering. When the bridge closes. (When command /bridgeclose) is used an alarm sounds to all players on or nearby the bridge. It would be great if we could have some help with this Thanks, Browneyadz
dzek (varez) Posted October 21, 2010 Posted October 21, 2010 https://wiki.multitheftauto.com/wiki/PlaySound3D (as position use bridge position)
browneyadz Posted October 21, 2010 Author Posted October 21, 2010 i used this but the sound is played all over the map
[DMC] Posted October 21, 2010 Posted October 21, 2010 look here, https://wiki.multitheftauto.com/wiki/PlaySound3D just technically copy the code and replace eventHandler with a commandHandler
dzek (varez) Posted October 21, 2010 Posted October 21, 2010 you can also post your script (including sound) and we can check what is wrong
[DMC] Posted October 21, 2010 Posted October 21, 2010 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 Zango Posted October 21, 2010 Discord Moderators Posted October 21, 2010 setSoundVolume is 0.0 - 1.0 not above 1.
[DMC] Posted October 21, 2010 Posted October 21, 2010 setSoundVolume is 0.0 - 1.0 not above 1. it doesnt really matter ...
Discord Moderators Zango Posted October 21, 2010 Discord Moderators Posted October 21, 2010 setSoundVolume is 0.0 - 1.0 not above 1. it doesnt really matter ... well at some point it does.. the sound volume is max by default anyways
dzek (varez) Posted October 21, 2010 Posted October 21, 2010 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 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 Zango Posted October 21, 2010 Discord Moderators Posted October 21, 2010 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
browneyadz Posted October 25, 2010 Author Posted October 25, 2010 Thank you. This works great. The distance of the sound isn't that far but its great ty
dzek (varez) Posted October 25, 2010 Posted October 25, 2010 these functions can help you https://wiki.multitheftauto.com/index.ph ... ance&go=Go
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