Raised This Month: $51 Target: $400
 12% 

heartbeat


Post New Thread Reply   
 
Thread Tools Display Modes
AlexBreems
Member
Join Date: Feb 2008
Old 03-24-2008 , 12:33   Re: heartbeat
Reply With Quote #21

Quote:
Originally Posted by spiderbites View Post
ah ok..btw i found a bug..if a player defuse bomb, and if he fails and die in the bomb explosion, the next time he respawns he can hear the heartbeat sound until he dies in that round
Try this:

PHP Code:
/* AMX Mod X Plugin

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

*/ 

#include <amxmodx>

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.12""ConnorMcLeod, AlexBreems")

    
g_pcvarLowHp register_cvar("heartbeat_hp""25")

    
register_event("Damage""e_Damage""be""2>0")
    
register_event("DeathMsg""e_DeathMsg""a")
    
register_event("ResetHUD""onPlayerSpawn""be")
    
register_event("Spectator""onSpectate""a")
}

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

    
emit_sound(idCHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM)
    
client_cmd(id"spk %s"g_heartbeat)
}

public 
e_DeathMsg()
{
    
emit_sound(read_data(2), CHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM)


public 
onPlayerSpawn(id)
{
    
emit_sound(idCHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM)
}

public 
onSpectate()
{
    
emit_sound(read_data(1), CHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM)

__________________
AlexBreems is offline
spiderbites
Senior Member
Join Date: Nov 2007
Old 03-24-2008 , 13:54   Re: heartbeat
Reply With Quote #22

looks like that has fixed that probem..i'll report again if i find another bugs
spiderbites is offline
spiderbites
Senior Member
Join Date: Nov 2007
Old 03-24-2008 , 23:31   Re: heartbeat
Reply With Quote #23

another comment. when a player with low hp dies, stop playing heartbeat sound for him instantly, otherwise he would hear the sound until that round ends
spiderbites is offline
AlexBreems
Member
Join Date: Feb 2008
Old 03-25-2008 , 05:30   Re: heartbeat
Reply With Quote #24

Quote:
Originally Posted by spiderbites View Post
another comment. when a player with low hp dies, stop playing heartbeat sound for him instantly, otherwise he would hear the sound until that round ends
This code in plugin stop playing heartbeat sound for him instantly:

PHP Code:
public e_DeathMsg() 

    
emit_sound(read_data(2), CHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM

I have checked up, at me all is normal
__________________
AlexBreems is offline
MikeFM
Member
Join Date: Jan 2008
Old 05-12-2008 , 12:07   Re: heartbeat
Reply With Quote #25

I have small problem with your last plugin, AlexBreems. Sometimes when one of players (it doesn't matter is it enemy or friend) has got low hp and hears heartbeat, other players hear it too even if they have max hp :/ Could you fix it?
(sorry 4 bad english)
MikeFM is offline
Banjo Boy
Member
Join Date: Apr 2008
Old 05-12-2008 , 12:40   Re: heartbeat
Reply With Quote #26

where can u download this plugin
__________________
Banjo Boy is offline
NestleMilo
BANNED
Join Date: May 2008
Location: http://zombieplague.org
Old 05-12-2008 , 13:12   Re: heartbeat
Reply With Quote #27

Quote:
Originally Posted by Banjo Boy View Post
where can u download this plugin
You have to compile it.
NestleMilo is offline
MikeFM
Member
Join Date: Jan 2008
Old 05-13-2008 , 08:22   Re: heartbeat
Reply With Quote #28

So is there any solution of my above problem?
MikeFM is offline
hazard1337
Senior Member
Join Date: Sep 2006
Old 05-13-2008 , 09:50   Re: heartbeat
Reply With Quote #29

Quote:
Originally Posted by Banjo Boy View Post
where can u download this plugin
PHP Code:
/* AMX Mod X Plugin 
*  
* (c) Copyright 2008, ConnorMcLeod  
* This file is provided as is (no warranties).  
*  
*/  
 
#include <amxmodx> 
 
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.12""ConnorMcLeod, AlexBreems"
 
    
g_pcvarLowHp register_cvar("heartbeat_hp""25"
 
    
register_event("Damage""e_Damage""be""2>0"
    
register_event("DeathMsg""e_DeathMsg""a"
    
register_event("ResetHUD""onPlayerSpawn""be"
    
register_event("Spectator""onSpectate""a"

 
public 
e_Damage(id

    if( 
get_user_health(id) > get_pcvar_num(g_pcvarLowHp) ) 
        return 
 
    
emit_sound(idCHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM
    
client_cmd(id"spk %s"g_heartbeat

 
public 
e_DeathMsg() 

    
emit_sound(read_data(2), CHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM
}  
 
public 
onPlayerSpawn(id

    
emit_sound(idCHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM

 
public 
onSpectate() 

    
emit_sound(read_data(1), CHAN_STATICg_heartbeat0.00.0SND_STOPPITCH_NORM

Copy and paste into a text document, save as a .sma, web compile or local compile it to .amxx
__________________
[IMG]http://img139.**************/img139/1530/2sejaewg1.gif[/IMG]
If you +/- my K, leave your name.
I do not take requests VIA PM
Click on this before requesting/suggesting
This is your best friend
hazard1337 is offline
Send a message via Skype™ to hazard1337
sniperkills
Senior Member
Join Date: Apr 2008
Old 09-24-2008 , 17:55   Re: heartbeat
Reply With Quote #30

ya there is but not in sm_ theres 1 for ev_
__________________
{ÄÕD}ۣۜ$ήiþëяҚillş
sniperkills is offline
Reply



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 07:04.


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