Raised This Month: $ Target: $400
 0% 

Disable blood animation.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-19-2021 , 17:54   Disable blood animation.
Reply With Quote #1

Hi there

I'm trying to help someone out with the following. I've got this code, but it's only working on the first hit. Also, the animation isn't removed, the color just turns black.

PHP Code:
public PreDisableBlood(id)
{
    if(
g_bUnderstabbed[id])
    {
        
client_print(0print_chat"Disable blood animation");
        
SetHamReturnInteger(-1);
        
g_bUnderstabbed[id] = false;
        return 
HAM_HANDLED;
    }
    return 
HAM_SUPERCEDE;

I'll just leave the entire code for any one who needs more information.

PHP Code:
/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <hamsandwich>

#define PLUGIN  "Anti UnderStab"
#define VERSION "1.0"
#define AUTHOR  "NapoleoN#"

#if !defined DMG_GRENADE
        #define DMG_GRENADE ( 1 << 24 )
#endif

#if !defined MAX_PLAYERS
        
const MAX_PLAYERS 32;
#endif

#define g_iIsPlayer(%0) (1 <= (%0) <= MAX_PLAYERS)

new bool:g_bUnderstabbed[MAX_PLAYERS 1];

new 
g_pYOffset;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
RegisterHam(Ham_TakeDamage"player""PreTakeDamage");
    
RegisterHam(Ham_BloodColor"player""PreDisableBlood");

    
g_pYOffset register_cvar("aus_offset""20");
}

public 
PreTakeDamage(iVictimiInflictoriAttackerFloat:fDamageiDmgBits)
{
    if(!
is_user_alive(iVictim) || !is_user_alive(iAttacker) || !g_iIsPlayer(iAttacker) || !g_iIsPlayer(iVictim) || iDmgBits    DMG_GRENADE)
    {
        return 
HAM_IGNORED;
    }

    if(
cs_get_user_weapon(iAttacker) == CSW_KNIFE && cs_get_user_team(iAttacker) == CS_TEAM_CT && cs_get_user_team(iVictim) == CS_TEAM_T)
    {
        new 
iAttOrigin[3];
        new 
iVicOrigin[3];

        
get_user_origin(iAttackeriAttOrigin);
        
get_user_origin(iVictimiVicOrigin);

        
iAttOrigin[2] += get_pcvar_num(g_pYOffset);

        if(
iVicOrigin[2] > iAttOrigin[2])
        {
            
g_bUnderstabbed[iVictim] = true;
            return 
HAM_SUPERCEDE;
        }
    }
    return 
HAM_IGNORED;
}

public 
PreDisableBlood(id)
{
    if(
g_bUnderstabbed[id])
    {
        
client_print(0print_chat"Disable blood animation");
        
SetHamReturnInteger(-1);
        
g_bUnderstabbed[id] = false;
        return 
HAM_HANDLED;
    }
    return 
HAM_SUPERCEDE;

__________________

Last edited by Napoleon_be; 09-19-2021 at 18:14.
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
 



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 11:40.


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