Jump to content

Question - Sound


manve1

Recommended Posts

When i use combo boxes and i have few problems with sound, as i am playing 2 sounds and i check which item was selected in the combo box. If i play one sound, then try play another sound, it just play's the one that was started to play firstly. I mean it doesn't change to different music type

Link to comment
addEventHandler('onClientGUIClick', buttonRadioPlay, 
function( ) 
if (guiComboBoxGetItemText(genreBox, 'Dance/Dj')) then 
if (sound) then 
stopSound( sound ) 
end 
sound = playSound( Dance_Dj ) 
elseif (guiComboBoxGetItemText(genreBox, 'Classic')) then 
if (sound) then 
stopSound( sound ) 
end 
sound = playSound( Classic ) 
end 
end 
) 

Every thing is defined, i just don't want to post the website link.

Link to comment
addEventHandler('onClientGUIClick', buttonRadioPlay, 
function( ) 
if (guiComboBoxGetItemText(genreBox, 'Dance/Dj')) then 
if (sound) then 
stopSound( sound ) 
end 
sound = playSound( Dance_Dj ) 
elseif (guiComboBoxGetItemText(genreBox, 'Classic')) then 
if (sound) then 
stopSound( sound ) 
end 
sound = playSound( Classic ) 
end 
end 
) 

Every thing is defined, i just don't want to post the website link.

well you didn't wrote the type of the sound and it should be a string

like this :

sound = playSound( 'Dance_Dj.mp3' ) 

Link to comment
im using a variable?

something like:

local a = 7 
local b = 2 
  
outputChatBox( 'A = '.. a ..' and B = '.. b, source, 255, 255, 255 ) 

o.k then :

guiComboBoxGetItemText ( element comboBox, int itemId ) 

comboBox: The combobox containing the item you're interested in

itemId: The index of the item

that's mean the number of item

Link to comment

it works with words aswell, after changing to numbers same problem

#Edit: The first one on top I mean like: Dance/Dj will play always whatever i chose in that combo box, BUT if i change to Classic to be on top of Dance/Dj the classic will always play

Link to comment
it works with words aswell, after changing to numbers same problem

#Edit: The first one on top I mean like: Dance/Dj will play always whatever i chose in that combo box, BUT if i change to Classic to be on top of Dance/Dj the classic will always play

Did you use guiComboBoxGetSelected ?

Link to comment

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