Raised This Month: $ Target: $400
 0% 

[Question]How To Increase Bullet Damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-24-2015 , 14:33   Re: [Question]How To Increase Bullet Damage
Reply With Quote #1

Attacker not being alive doesn't matter here and you are not checking if the damage is from a bullet. You should return HAM_HANDLED after SetHamParamFloat().

Modified TakeDamage to increase damage from bullets only.
PHP Code:
#define DMG_BULLET (1<<1)     

public fw_TakeDamagevictiminflictorattackerFloat:damagedamage_type )
{
    if ( !( 
damage_type DMG_BULLET ) )
        return 
HAM_IGNORED;  

    
SetHamParamFloatdamage get_pcvar_floatg_amount ) );
    
    return 
HAM_HANDLED;

Modify damage from any weapon, including grenades
PHP Code:
#include <amxmodx>
#include <hamsandwich> 

#define IsPlayer(%1)    (1<=%1<=g_maxplayers)

new g_amount g_maxplayers;

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

    
g_amount register_cvar"amx_damage_increase" "1.5" );
    
g_maxplayers get_maxplayers();
}

public 
fw_TakeDamagevictim inflictor attacker Float:damage damage_type )
{
    if ( !
IsPlayerattacker ) )
        return 
HAM_IGNORED;  
    
    
SetHamParamFloatdamage get_pcvar_floatg_amount ) );
    
    return 
HAM_HANDLED;

__________________

Last edited by Bugsy; 12-24-2015 at 14:57.
Bugsy 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 17:59.


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