StefanAlmighty Posted October 30, 2015 Share Posted October 30, 2015 How can I broadcast a 'playSound' to everybody in the server? Is this possible & how can I accomplish this? Link to comment
Dimos7 Posted October 30, 2015 Share Posted October 30, 2015 function broadcast() local sound = playSound("music") setSoundVolume(sound, 1.0) end in music put the mp3 name and path for example if the song is inside a folder named sounds you put sounds/.mp3 that it Link to comment
Addlibs Posted October 30, 2015 Share Posted October 30, 2015 How can I broadcast a 'playSound' to everybody in the server? Is this possible & how can I accomplish this? Trigger a client event from server for everybody, which is attached to playSound. Client: addEvent("broadcast playSound", true) addEventHandler("broadcast playSound", root, playSound) Server: triggerClientEvent(root, "broadcast playSound", resourceRoot, "sound URL", loop) Link to comment
Aristates Posted October 31, 2015 Share Posted October 31, 2015 Ed:This is My Code. should on working Client - side addEventHandler("onClientResourceStart", root, function() triggerServerEvent("start", getLocalPlayer()) end ) addEvent("song", true) addEventHandler("song", root, function(player) stream = playSound(tostring(player)) end ) Server - side addEvent("start", true) addEventHandler("start",root, function() sound = "http://www.mtaturk.net/upload/uploads/Fast%20Furious%204%20SoundTrack%20-%20Krazy%20PitBull%20ft%20Lil%20Jon%20HD%20720p.mp3" triggerClientEvent("song", resourceRoot, sound) end ) Link to comment
jingzhi Posted November 19, 2015 Share Posted November 19, 2015 How can I broadcast a 'playSound' to everybody in the server? Is this possible & how can I accomplish this? specifiy a sound element then triggerClientEvent for all the players in the server by using getElementsByTtype("player") and loop them, so it's sent to all the players in the server 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