Raised This Month: $ Target: $400
 0% 

Just a stupid Question..About Damage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-30-2010 , 21:04   Re: Just a stupid Question..About Damage
Reply With Quote #5

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

const FloatfDmgPercent 0.50;

public 
plugin_init()
{
    
RegisterHam(Ham_TakeDamage"player""FwdTakeDamage");
}

public 
FwdTakeDamageiVictim iInflictor iAttacker Float:fDamage iDamagebits )
{
    
//fDamage passed to this forward is the amount of damage caused to victim
    
    //Here you multiply the damage value by whatever multiplier you want.
    //In this example, fDmgPercent is 0.50 meaning the damage amount will
    //be reduced by half.
    
new FloatfResult = ( fDamage fDmgPercent );
    
    
//This modifies the damage value passed to the game engine to make
    //our calculated damage value take effect.
    
SetHamParamFloatfResult );
    
    return 
HAM_HANDLED;

__________________
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 00:11.


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