Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Sound problem

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 11th Dec 2010 14:54
How can i make the sound turn on and off when i press M.
I tried this code, but i press M and the sound stops and starts again quickly.
Forward thanks.
WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 11th Dec 2010 18:06
You will need use a flag for the mute status and also you may need to wait for the release of the key too. You way you've got it set up there you have to hold down the key permanently for the music to be on...

Warning! May contain Nuts!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 15th Dec 2010 20:30 Edited at: 15th Dec 2010 20:30
replace "else" with "if ( dbKeyState(50)==0&&mute==true )" or anything with same meaning

Your signature has been erased by a mod - Please reduce it to 600x120 maximum size
health
13
Years of Service
User Offline
Joined: 24th Dec 2010
Location:
Posted: 24th Dec 2010 19:19
Make sure the output device (speakers or headphones) are connected and turned on. Make sure the output device is not muted and the volume of the output device and the program volume is high enough you can hear it.

Noley
13
Years of Service
User Offline
Joined: 13th Dec 2010
Location:
Posted: 25th Dec 2010 20:32 Edited at: 25th Dec 2010 20:42
Try using dbTimer() to set a cooldown after the inital M press so that it doesn't spam the output of the code.

Using the following code Press M to mute, press M again to unmute:


That's basically how I do the Skills in my game. =]
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 3rd Jan 2011 21:02
Thank you very much!

Login to post a reply

Server time is: 2024-06-28 01:28:00
Your offset time is: 2024-06-28 01:28:00