Raised This Month: $ Target: $400
 0% 

Help making a sound stop looping.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mokasin
New Member
Join Date: Sep 2009
Old 09-04-2009 , 00:30   Help making a sound stop looping.
Reply With Quote #1

I've made some changes to my blockmakers heal block, so it plays a sound when walked on.
How can i prevent the sound from looping while standing on it?

So far my code looks like this:
PHP Code:
actionHeal(id)
{
    if (
halflife_time() >= gfNextHealTime[id])
    {
        new 
hp get_user_health(id);
        new 
amount floatround(get_cvar_float("bm_healamount"), 

floatround_floor);
        new 
sum = (hp amount);
        
        if (
sum 100)
        {
            
set_user_health(idsum);
        }
        else
        {
            
set_user_health(id100);
        }
        
        
gfNextHealTime[id] = halflife_time() + 0.5;
        
        
//play heal sound
        
emit_sound(idCHAN_STATICgszHealSound1.0ATTN_NORM0

PITCH_NORM);
    }

I'm sorry, didn't realize that i put 60.0 in there. It should be 0.5.
__________________
Game Recognizes Game

Last edited by Mokasin; 09-04-2009 at 02:39.
Mokasin is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 09-04-2009 , 01:24   Re: Help making a sound stop looping.
Reply With Quote #2

It heals once every 60 seconds? It looks like the sound shouldn't be looping already, as it's only played when the player is healed.

Maybe try changing the channel to CHAN_AUTO?

It doesn't look like it could possibly be looping though, unless you've got a sound elsewhere as well.
__________________
Bad_Bud is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode