Raised This Month: $ Target: $400
 0% 

Mirror Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 05-19-2010 , 13:07   Re: Mirror Damage
Reply With Quote #1

Yes, it is .

PHP Code:
#include <amxmodx>
#include <hamsandwich>

new g_cDamageFactor

public plugin_init()
{
      
register_plugin("Mirror Damage""1.0.0""EKS");
      
      
g_cDamageFactor register_cvar("md_damage_factor""0.2");
      
      
RegisterHam(Ham_TakeDamage"player""Fwd_TakeDamage");
}

public 
Fwd_TakeDamage(iVictimiInflictoriAttackerFloat:flDamageiDamageBits)
{
      if((
get_user_team(iVictim) == get_user_team(iAttacker)) && (iVictim != iAttacker))
      {
            if(
get_user_health(iVictim) < flDamage)
                  
SetHamParamFloat(4flDamage get_pcvar_float(g_cDamageFactor));
      }
      
      return 
HAM_IGNORED;

Not tested and, if you want to implement this in a plugin, you'll have to optimize it as well.
I have written this in hurry and didn't have time to optimize.
__________________

Last edited by unnyquee; 05-19-2010 at 13:24.
unnyquee is offline
tm.
Member
Join Date: Apr 2010
Old 05-19-2010 , 14:53   Re: Mirror Damage
Reply With Quote #2

Hmm, thanks, but not exactly what I need. I don't want to minimize the damage, I want to block victim's death even in the worst case scenario, let's say he has 1 hp and gets a headshot with awp.
And another question, related somehow to this: it's possible to restore the victim's armor, without using set_task?
tm. 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 03:54.


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