Quote:
Originally Posted by instinctpt1
Make changes in plugin then ..
|
Hmm, thank you. At least I know I'm on the right track. But what should be changed?
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
new const PLUGIN[] = "Heartbeat";
new const VERSION[] = "0.1b";
new const HEARTBEAT_SOUND[] = "player/heartbeat1.wav";
new bool:g_is_critical[33];
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "hellmonja");
RegisterHam(Ham_Spawn, "player", "Ham_Heartbeat_Stop_Post", true);
RegisterHam(Ham_Killed, "player", "Ham_Heartbeat_Stop_Post", true);
RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_Post", true);
}
public Ham_Heartbeat_Stop_Post(player)
{
if(g_is_critical[player] == true)
{
g_is_critical[player] = false;
client_cmd(player, "stopsound");
}
}
public Ham_TakeDamage_Post(victim, inflictor, attacker, Float:damage, dmgbits)
{
if(g_is_critical[victim] == true)
return HAM_IGNORED
if(0 < get_user_health(victim) <= 25)
{
client_cmd(victim, "spk %s", HEARTBEAT_SOUND);
g_is_critical[victim] = true;
}
return HAM_IGNORED
}
The plugin seem pretty straight forward...
__________________