DennisUni Posted January 10, 2012 Share Posted January 10, 2012 (edited) meh Edited April 7, 2013 by Guest Link to comment
Xeno Posted January 10, 2012 Share Posted January 10, 2012 I'm not sure if it will work, but try make it so it sets the radio sound to 0? Link to comment
SDK Posted January 10, 2012 Share 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. Link to comment
myonlake Posted January 11, 2012 Share 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) Link to comment
Al3grab Posted January 11, 2012 Share 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) Link to comment
DennisUni Posted January 11, 2012 Author Share 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? Link to comment
mjau Posted January 11, 2012 Share 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) Link to comment
DennisUni Posted January 11, 2012 Author Share 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! Link to comment
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