Raised This Month: $ Target: $400
 0% 

Hit/Knife in back/rear ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 06-21-2014 , 10:42   Re: Hit/Knife in back/rear ?
Reply With Quote #1

You can try to hook TraceAttack on "player", check if player was attacked with knife.

When dealing dmg with a knife stab, it hurts 65hp points, but if it's from behind, this gets mult by 3, so the total damage done it's 195hp points. There wouldn't be other greater dmg value, so you can use it to check.

Or also, you can imitate engine's way to check if player attacked behind another:

PHP Code:
    UTIL_MakeVectorsm_pPlayer->pev->v_angle ); 
    
// and later...

    
float flDamage 65.0;
        if( 
pEntity && pEntity->IsPlayer() )        
    {            
        
Vector2D vec2LOS;            
        
Vector vecForward gpGlobals->v_forward;
        
UTIL_MakeVectorsm_pPlayer->pev->angles );
        
vec2LOS vecForward.Make2D();            
        
vec2LOS vec2LOS.Normalize();
        if( 
DotProductvec2LOSgpGlobals->v_forward.Make2D() ) > 0.8 )            
        {                    
            
flDamage *= 3.0;            
        }        
    }
        
UTIL_MakeVectorsm_pPlayer->pev->v_angle );        
    
ClearMultiDamage();
        
pEntity->TraceAttackm_pPlayer->pevflDamagegpGlobals->v_forward, &trDMG_NEVERGIB DMG_BULLET );        
    
ApplyMultiDamagem_pPlayer->pevm_pPlayer->pev ); 
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 21:12.


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