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(id, sum);
}
else
{
set_user_health(id, 100);
}
gfNextHealTime[id] = halflife_time() + 0.5;
//play heal sound
emit_sound(id, CHAN_STATIC, gszHealSound, 1.0, ATTN_NORM, 0,
PITCH_NORM);
}
}
I'm sorry, didn't realize that i put 60.0 in there. It should be 0.5.
__________________