Jump to content

How to end onVehicleExit


ViRuZGamiing

Recommended Posts

Posted

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

Posted

What do you mean by "end"?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

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