AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   heartbeat (https://forums.alliedmods.net/showthread.php?t=66979)

netrider 02-12-2008 23:31

heartbeat
 
hello is there a plugin that for example when you have 10 health or less you can hear the heartbeating ? or when getting low on health

thanks

Exolent[jNr] 02-13-2008 07:12

Re: heartbeat
 
im sure there is... did you search first?

Sn!ff3r 02-21-2008 22:44

Re: heartbeat
 
My searching result also bring no positive results...

EDIT: Ok, i written this plugin ;)

AlexBreems 03-07-2008 03:48

Re: heartbeat
 
very nice idea!

Styles 03-07-2008 14:04

Re: heartbeat
 
its made Realism Mod I belive..

AlexBreems 03-08-2008 03:02

Re: heartbeat
 
Quote:

Originally Posted by styles (Post 594246)
its made Realism Mod I belive..

no

ConnorMcLeod 03-08-2008 07:28

Re: heartbeat
 
Try this
PHP Code:

/* AMX Mod X Plugin

* (c) Copyright 2008, ConnorMcLeod 
* This file is provided as is (no warranties). 

*/ 

#include <amxmodx>

#define VOL_NULL    0.0
#define VOL_MID    0.5
#define FLAG_NONE    0
#define PITCH_NONE    0
#define CHAN_HEART    CHAN_VOICE

new const g_heartbeat[] = "player/heartbeat1.wav"

new g_pcvarLowHp

public plugin_precache()
{
    
precache_sound(g_heartbeat)
}

public 
plugin_init()
{
    
register_plugin("Low Hp Heart Beat""0.1""ConnorMcLeod")

    
g_pcvarLowHp register_cvar("heartbeat_hp""25")

    
register_event("Damage""e_Damage""be""2>0")
    
register_event("DeathMsg""e_DeathMsg""a")
}

public 
e_Damage(id)
{
    if( 
get_user_health(id) > get_pcvar_num(g_pcvarLowHp) )
        return

    
emit_sound(idCHAN_HEARTg_heartbeatVOL_NULLATTN_NONESND_STOPPITCH_NONE)
    
emit_sound(idCHAN_HEARTg_heartbeatVOL_MIDATTN_NORMFLAG_NONEPITCH_NORM)
}

public 
e_DeathMsg()
{
    
emit_sound(read_data(2), CHAN_HEARTg_heartbeatVOL_NULLATTN_NONESND_STOPPITCH_NONE)



AlexBreems 03-09-2008 01:59

Re: heartbeat
 
Quote:

Originally Posted by connorr (Post 594493)
Try this

don't work

When I have replaced CHAN_BODY on CHAN_AUTO it became better, but all the same sometimes the plugin works and sometimes is not present

ConnorMcLeod 03-15-2008 08:42

Re: heartbeat
 
Fixed.

spiderbites 03-21-2008 17:38

Re: heartbeat
 
where do i put the sound file?


All times are GMT -4. The time now is 05:02.

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