|
6 registered members (vince, VHX, Grant, Geir, juergenwue, 1 invisible),
3,464
guests, and 32
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: why The sound repeated
[Re: Tonyjack221]
#399277
04/13/12 14:57
04/13/12 14:57
|
Joined: Oct 2011
Posts: 1,082 Germany
Ch40zzC0d3r
Serious User
|
Serious User
Joined: Oct 2011
Posts: 1,082
Germany
|
Just make an event with: on_mouse_left = playmySound; This will fix your issues 
|
|
|
Re: why The sound repeated
[Re: Tonyjack221]
#399284
04/13/12 15:29
04/13/12 15:29
|
Joined: Jun 2011
Posts: 75 algeria
Tonyjack221
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2011
Posts: 75
algeria
|
doesn't work look i use that code: action pikme() {
my.emask |= ENABLE_CLICK; set(me,SHADOW); c_setminmax(me); my.event = move_me;
while(1) { my.alpha=70; pick_function(); scan_you(); if(my.skill6==0) { snd_play(SND_FINAL, 100, 0); } wait(1); } } i can't use on_mouse_left
Last edited by Tonyjack221; 04/13/12 15:35.
|
|
|
Re: why The sound repeated
[Re: Ch40zzC0d3r]
#399293
04/13/12 19:23
04/13/12 19:23
|
Joined: Aug 2009
Posts: 1,438 Spain
painkiller
Serious User
|
Serious User
Joined: Aug 2009
Posts: 1,438
Spain
|
or this way:
if(mouse_left)
{
snd_play(SND_FINAL, 100, 0);
while(mouse_left) wait(1);
}
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
|
|
|
Re: why The sound repeated
[Re: Ch40zzC0d3r]
#399294
04/13/12 19:27
04/13/12 19:27
|
Joined: May 2009
Posts: 5,377 Caucasus
3run
Senior Expert
|
Senior Expert
Joined: May 2009
Posts: 5,377
Caucasus
|
Try to use this simple method:
function event_blahblah()
{
var snd_once = 1; // ******
while(1)
{
my.alpha = 70;
pick_function();
scan_you();
// play sound only if skill6 is "0" and snd_once is "1":
if(my.skill6 == 0 && snd_once) // ******
{
snd_play(SND_FINAL, 100, 0);
snd_once = 0; // don't allow to play again
}
// till we release mouse_left:
if(!mouse_left && snd_once == 0){snd_once = 1;} // ******
wait(1);
}
}
I've commented it, plus add "* * *" on those lines, where I've add anything. I won't recommend approach with another wait loop, cause that will stop the previous one, till you release the button.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|