AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help making a sound stop looping. (https://forums.alliedmods.net/showthread.php?t=102565)

Mokasin 09-04-2009 00:30

Help making a sound stop looping.
 
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.

Bad_Bud 09-04-2009 01:24

Re: Help making a sound stop looping.
 
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.


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

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