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(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
{
if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
return PLUGIN_CONTINUE
if (get_user_weapon(iAttacker) == CSW_KNIFE)
{
SetHamParamFloat(4, fDamage * get_pcvar_float(g_pCvarDamage)) // not sure if this line is correct
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}