Raised This Month: $ Target: $400
 0% 

Remaining Health on Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-29-2010 , 22:24   Re: Remaining Health on Damage
Reply With Quote #1

Code:
#include < amxmodx > #include < fakemeta > #include < hamsandwich > const MAX_PLAYERS = 32; new Float:g_flTakeDamage_Health[ MAX_PLAYERS + 1 ]; public plugin_init( ) {     RegisterHam( Ham_TakeDamage, "player", "FwdPlayerDamage" );     RegisterHam( Ham_TakeDamage, "player", "FwdPlayerDamagePost", 1 ); } public FwdPlayerDamage( iVictim, iInflictor, iAttacker, Float:flDamage, iDamageType ) {     // save player's health before the damage is done     pev( iVictim, pev_health, g_flTakeDamage_Health[ iVictim ] ); } public FwdPlayerDamagePost( iVictim, iInflictor, iAttacker, Float:flDamage, iDamageType ) {     // gets real damage that was affected by armor     // flDamage in the forward params does not have the armor-affected value     // you can only get this in POST hook (not PRE)     new Float:flRealDamage;     pev( iVictim, pev_dmg_take, flRealDamage );         // the amount of health taken from the player     new Float:flHealthTaken = floatmin( flRealDamage, g_flTakeDamage_Health[ iVictim ] ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 11:17.


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