ViRuZGamiing Posted December 29, 2013 Posted December 29, 2013 As title says, local dubstepSound = { "sounds/1.mp3", "sounds/2.mp3", } local sound = nil local keyBoundedDubStep = false local lastTrack = nil local controlDubstepClient = function (playState) if not isElement(sound) then local dubstepSound = dubstepSound if lastTrack then table.remove(dubstepSound,lastTrack) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) elseif playState then setSoundPaused (sound,not isSoundPaused ( sound )) end end local dubstepClient = function () if not keyBoundedDubStep then bindKey ( "M", "down", controlDubstepClient,true) keyBoundedDubStep = true end if isElement(sound) then stopSound(sound) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) end addEvent("dubstepPlay", true) addEventHandler("dubstepPlay", root, dubstepClient) addEventHandler ( "onClientSoundStopped", root, function (reason) if reason == "finished" then local dubstepSound = dubstepSound if lastTrack then table.remove(dubstepSound,lastTrack) end sound = playSound(dubstepSound[ math.random( #dubstepSound )]) end end) "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
Castillo Posted December 29, 2013 Posted December 29, 2013 What do you mean by "end"? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
ViRuZGamiing Posted December 29, 2013 Author Posted December 29, 2013 It's fixed, by end I ment end the mp3. did it with onClientVehicleExit. "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
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