Raised This Month: $ Target: $400
 0% 

[Solved] Show Final Damage done


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-18-2015 , 09:07   Re: [Help] Damage done
Reply With Quote #4

damage in Ham_TakeDamage is total inflicted damage. If the player has armor then they will not receive this full damage amount.

If you are trying to get the victims loss in hp, you need to hook Ham_TakeDamage post and get pev( victim , pev_dmg_take )
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "fw_TakeDamage_Post" );
}

public 
fw_TakeDamage_PostiVictim iInflictor iAttacker Float:fDamage DmgBits )
{
    new 
iVictimDamage peviVictim pev_dmg_take );
    
    
client_printprint_chat "%d received %d loss in hp" iVictim iVictimDamage );

This can be done in conjunction with modifying the amount of damage:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

public plugin_init() 
{
    
RegisterHamHam_TakeDamage "player" "fw_TakeDamage" );
    
RegisterHamHam_TakeDamage "player" "fw_TakeDamage_Post" );
}

public 
fw_TakeDamageiVictim iInflictor iAttacker Float:fDamage DmgBits )
{
    
//Triple damage
    
fDamage *= 3.0;

    
SetHamParamFloatfDamage );
    
    return 
HAM_HANDLED;
}

public 
fw_TakeDamage_PostiVictim iInflictor iAttacker Float:fDamage DmgBits )
{
    new 
iVictimDamage peviVictim pev_dmg_take );
    
    
client_printprint_chat "%d received %d loss in hp" iVictim iVictimDamage );

__________________

Last edited by Bugsy; 10-18-2015 at 09:12.
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 22:11.


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