Raised This Month: $ Target: $400
 0% 

How to collect hitbox information?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-28-2015 , 18:59   Re: How to collect hitbox information?
Reply With Quote #2

Here's how to get the info. You can also determine the type of damage (bullet, grenade, drown, fire, etc) using the DamageBits bitsum.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "TakeDamage" true );
}

public 
TakeDamageiVictim iInflictor iAttacker Float:fDamage DamageBits )
{
    static const 
m_iLastHitGroup 75;
    static const 
XO_Player 5;
    
    
//Total damage inflicted on victim. This is not the actual loss in hp of victim since this
    //damage value is reduced by armor that the victim may have.
    
client_printprint_chat "Damage inflicted = %d" floatroundfDamage ) );
    
    
//Actual damage taken by victim (loss in hp).
    
client_printprint_chat "Damage realized = %d" peviVictim pev_dmg_take ) );
    
    
//Body part that was hit.
    
switch ( get_pdata_intiVictim m_iLastHitGroup XO_Player ) )
    {
        case 
HIT_HEADclient_printprint_chat "Hit head" );
        case 
HIT_LEFTARMHIT_RIGHTARMclient_printprint_chat "Hit arm" );
        case 
HIT_CHESTclient_printprint_chat "Hit chest" );
        case 
HIT_STOMACHclient_printprint_chat "Hit stomach" );
        case 
HIT_LEFTLEGHIT_RIGHTLEGclient_printprint_chat "Hit leg" );
    }
    

__________________

Last edited by Bugsy; 11-28-2015 at 19:04.
Bugsy is offline
 



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 17:53.


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