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

[REQ] ZP HeartBit Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-28-2014 , 04:13   [REQ] ZP HeartBit Plugin
Reply With Quote #1

can some one ! make this plugin for 5.0.8a

https://forums.alliedmods.net/showpo...postcount=1299
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-28-2014 , 07:00   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <zp50_core>

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

new cvar_heartbeathp

public plugin_precache()
{
    
precache_sound(g_heartbeat)
}

public 
plugin_init()
{
    
register_plugin("[ZP] Low HP Heartbeat""1.1""ConnorMcLeod/MeRcyLeZZ")
    
    
register_event("Damage""event_damage""be""2>0")
    
register_event("DeathMsg""event_deathmsg""a")
    
register_event("ResetHUD""event_resethud""be")
    
register_event("Spectator""event_spectator""a")
    
    
cvar_heartbeathp register_cvar("zp_heartbeat_hp""50")
}

public 
event_damage(id)
{
    if (
get_user_health(id) > get_pcvar_num(cvar_heartbeathp) || zp_core_is_zombie(id))
        return;
        
    
emit_sound(idCHAN_AUTOg_heartbeat1.0ATTN_NORM0PITCH_NORM)
}

public 
event_deathmsg()
{
    
emit_sound(read_data(2), CHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)
}

public 
event_resethud(id)
{
    
emit_sound(idCHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)
}

public 
event_spectator()
{
    
emit_sound(read_data(1), CHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)


Last edited by zmd94; 09-28-2014 at 07:03.
zmd94 is offline
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-28-2014 , 07:53   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #3

nothing happening .. still not work

have you this sound effect ? player/heartbeat1.wav

that's does't exist on my server

and can you add effect blood on screen or something like that
__________________
the city is no fun
there is no sun
and its so dark

Last edited by cr0w; 09-28-2014 at 07:55.
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 09-28-2014 , 07:56   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #4

You need the heartbeat1.wav file for this plugin. Just search in the internet. ;)
zmd94 is offline
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-28-2014 , 10:39   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #5

i have add a sound but still not working .
__________________
the city is no fun
there is no sun
and its so dark

Last edited by cr0w; 09-28-2014 at 10:40.
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 09-28-2014 , 22:59   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #6

PHP Code:
/*================================================================================
    
    ---------------------------------
    -*- [ZP] Low HP Heartbeat 1.1 -*-
    ---------------------------------
    
    ~~~~~~~~~~~~~~~
    - Description -
    ~~~~~~~~~~~~~~~
    
    This plugin plays a heartbeat sound on humans when their health
    is under certain amount.
    
    ~~~~~~~~~
    - CVARS -
    ~~~~~~~~~
    
    * zp_heartbeat_hp <50> - Heartbeats start when HP is lower than this
    
    ~~~~~~~~~~~~~~
    - Credits to -
    ~~~~~~~~~~~~~~
    
    * ConnorMcLeod, AlexBreems: for the original plugin
    
================================================================================*/

#include <amxmodx>
#include <zp50_core>

/*================================================================================
 [Plugin Customization]
=================================================================================*/

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

/*============================================================================*/

new cvar_heartbeathp

public plugin_precache()
{
    
precache_sound(g_heartbeat)
}

public 
plugin_init()
{
    
register_plugin("[ZP] Low HP Heartbeat""1.1""ConnorMcLeod/MeRcyLeZZ")
    
    
register_event("Damage""event_damage""be""2>0")
    
register_event("DeathMsg""event_deathmsg""a")
    
register_event("ResetHUD""event_resethud""be")
    
register_event("Spectator""event_spectator""a")
    
    
cvar_heartbeathp register_cvar("zp_heartbeat_hp""50")
}

public 
event_damage(id)
{
    if (
get_user_health(id) > get_pcvar_num(cvar_heartbeathp) || zp_core_is_zombie(id))
        return;
    
    
// * Replaced with emit_sound so players near us can hear it too *
    //client_cmd(id, "spk %s", g_heartbeat)
    //emit_sound(id, CHAN_STATIC, g_heartbeat, 0.0, 0.0, SND_STOP, PITCH_NORM)
    
    
emit_sound(idCHAN_AUTOg_heartbeat1.0ATTN_NORM0PITCH_NORM)
}

public 
event_deathmsg()
{
    
emit_sound(read_data(2), CHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)
}

public 
event_resethud(id)
{
    
emit_sound(idCHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)
}

public 
event_spectator()
{
    
emit_sound(read_data(1), CHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)
}

public 
zp_fw_core_infect_post(idattacker)
{
    
emit_sound(idCHAN_AUTOg_heartbeat1.0ATTN_NORMSND_STOPPITCH_NORM)


Last edited by wicho; 09-28-2014 at 23:03.
wicho is offline
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-29-2014 , 10:25   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #7

nothing ..

maybe not working .. some one can make it by another way ? that's just a basic plugin any one can make it
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 09-29-2014 , 14:58   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #8

I tested and work fine, i dunno why dont work with u..
wicho is offline
cr0w
Senior Member
Join Date: Mar 2014
Location: middle east
Old 09-30-2014 , 07:22   Re: [REQ] ZP HeartBit Plugin
Reply With Quote #9

can you give me .amxx + sound ?
__________________
the city is no fun
there is no sun
and its so dark
cr0w is offline
Send a message via Yahoo to cr0w Send a message via Skype™ to cr0w
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 01:34.


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