Xeno Posted January 10, 2012 Posted January 10, 2012 I'm not sure if it will work, but try make it so it sets the radio sound to 0?
SDK Posted January 10, 2012 Posted January 10, 2012 Use https://wiki.multitheftauto.com/wiki/StopSound This code is clientside, client code never affects other players but the local player.
myonlake Posted January 11, 2012 Posted January 11, 2012 Not giving you any other code, but this is the one fixed. As SDK said, check out the Wiki's stopSound client function. local streamURL = "http://www.true.nl/streams/slamfmlivestream.pls" local radius = 150 local volume = 1.0 function radio3d() local x, y, z = getElementPosition(localPlayer) local sound = playSound3D(streamURL, x, y, z, true) setSoundVolume(radio, volume) setSoundMaxDistance(radio, radius) end addCommandHandler("staffradio", radio3d)
Al3grab Posted January 11, 2012 Posted January 11, 2012 local streamURL = "http://www.true.nl/streams/slamfmlivestream.pls" local radius = 150 local volume = 1.0 local s = false function radio3d() if s then stopSound(sound) s = false return end s = true local x, y, z = getElementPosition(localPlayer) local sound = playSound3D(streamURL, x, y, z, true) setSoundVolume(sound , volume) setSoundMaxDistance(sound , radius) end addCommandHandler("staffradio", radio3d)
DennisUni Posted January 11, 2012 Author Posted January 11, 2012 Thanks that works, i made i gui on it now so all works great. But i have one more question, where can i find info about attach the radio to a vehicle when player is in a vehicle?
mjau Posted January 11, 2012 Posted January 11, 2012 https://wiki.multitheftauto.com/wiki/AttachElements Just attach the sound to a vehicle sound = playSound3D blah blah blah vehicle = createVehicle(blah blah blah) attachElements(sound, vehicle)
DennisUni Posted January 11, 2012 Author Posted January 11, 2012 Thanks for your help! I have it working now. I trigger the serverside event, and via there i start the 3DSound client side, so now all users hear it and not only me. Script is completed now!
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