Raised This Month: $ Target: $400
 0% 

Solved [HELP] Stop HeartBeat Sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 04-26-2018 , 14:59   Re: [HELP] Stop HeartBeat Sound
Reply With Quote #1

Quote:
Originally Posted by instinctpt1 View Post
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(PLUGINVERSION"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(victiminflictorattackerFloat:damagedmgbits)
{
    if(
g_is_critical[victim] == true)
        return 
HAM_IGNORED
    
    
if(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...
__________________
hellmonja 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 04:36.


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