Raised This Month: $ Target: $400
 0% 

Ham Damage (Knife)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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:23.


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