Jump to content

Sound played


browneyadz

Recommended Posts

Posted
https://wiki.multitheftauto.com/wiki/PlaySound3D (as position use bridge position)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

you can also post your script (including sound) and we can check what is wrong

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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) 

logo_left.png
  • 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?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

  • 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

Posted

this is more than possible

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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