Enter the weapons for which you want damage to be modified in the MULTIPLIER_WEAPONS const in the same way the current ones are listed. Set DMG_MULTIPLIER to the value that you want damage to be multiplied by. Default is 2.0, you can also reduce damage with this by using a value less than 1.0. Let me know if you have any problems, I quickly tested it and it worked. Something like this I'm sure already exists.
PHP Code:
#include <amxmodx>
#include <hamsandwich>
new const Version[] = "0.1";
const DMG_GRENADE = ( 1 << 24 );
//Weapons that are affected by the multiplier:
const MULTIPLIER_WEAPONS =
(
( 1 << CSW_HEGRENADE ) |
( 1 << CSW_AWP ) |
( 1 << CSW_AK47 )
);
//Damage gets multiplied by this:
const Float:DMG_MULTIPLIER = 2.0;
new g_iMaxPlayers;
#define IsPlayer(%1) (1<=%1<=g_iMaxPlayers)
public plugin_init()
{
register_plugin( "Damage Multiplier" , Version , "bugsy" );
RegisterHam( Ham_TakeDamage , "player" , "fw_HamTakeDamage" );
g_iMaxPlayers = get_maxplayers();
}
public fw_HamTakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , DmgBits )
{
if ( IsPlayer( iAttacker ) &&
( ( ( DmgBits & DMG_GRENADE ) && ( MULTIPLIER_WEAPONS & ( 1 << CSW_HEGRENADE ) ) ) ||
( !( DmgBits & DMG_GRENADE ) && ( MULTIPLIER_WEAPONS & ( 1 << get_user_weapon( iAttacker ) ) ) ) ) )
{
SetHamParamFloat( 4 , fDamage * DMG_MULTIPLIER );
return HAM_HANDLED;
}
return HAM_IGNORED;
}
Damage issued
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
new const Version[] = "0.1";
public plugin_init()
{
register_plugin( "Damage" , Version , "bugsy" )
RegisterHam( Ham_TakeDamage , "player" , "fw_HamTakeDamage" , 1 );
}
public fw_HamTakeDamage( iVictim , iInflictor , iAttacker , Float:fDamage , DmgBits )
{
//fDamage is the total damage issued to a player. If the victim has armor, the
//armor will absorb some of the damage which will result in the victims reduction in hp
//to be less than fDamage.
//This is the reduction in victims hp.
new iDamage = pev( iVictim , pev_dmg_take );
}
__________________