View Single Post
mentalproblems
Junior Member
Join Date: Mar 2019
Old 09-17-2019 , 07:57   Re: Ham Damage (Knife)
Reply With Quote #8

Well as much as I could possibly understand, I somehow managed to reach this point.
But not sure if this is fully correct. And I would also like to make this work only for RIGHT CLICK Stab.

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

new g_pCvarDamage

public plugin_init() {
    
register_plugin("Knife Damage Multiplier""1.0""Nevermind")
    
    
RegisterHam(Ham_TakeDamage"player""Fw_TakeDamage_Post"1)
    
    
g_pCvarDamage register_cvar("knife_damage_multiplier""2")
}

public 
Fw_TakeDamage_Post(iVictimiInflictoriAttackerFloat:fDamagebitsDamageType)
{
    if (!
is_user_alive(iVictim) || !is_user_alive(iAttacker))
        return 
PLUGIN_CONTINUE
    
    
if (get_user_weapon(iAttacker) == CSW_KNIFE)
    {
        
SetHamParamFloat(4fDamage get_pcvar_float(g_pCvarDamage)) // not sure if this line is correct
        
return PLUGIN_CONTINUE
    
}
    
    return 
PLUGIN_CONTINUE


Last edited by mentalproblems; 09-17-2019 at 08:04.
mentalproblems is offline