Solved Knife Damage multiplier

Coding Help/Re-API Supported
Post Reply
neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

Knife Damage multiplier

#1

Post by neverminddw » 4 years ago

Hi. Can anyone show me how do I convert this to work with HamSandwich..

How do I make this work? SetHookChainArg ????

NOTE: This is not the original plugin, I got these from ze_vip_features.sma and modified as much as I knew... but need some help now.
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <hamsandwich>
  4.  
  5. new g_pCvarDamage
  6.  
  7. public plugin_init() {
  8.     register_plugin("Knife Damage Multiplier", "1.0", "Nevermind")
  9.    
  10.     RegisterHam(Ham_TakeDamage, "player", "Fw_TakeDamage_Post", 1)
  11.    
  12.     g_pCvarDamage = register_cvar("knife_damage_multiplier", "2")
  13. }
  14.  
  15. public Fw_TakeDamage_Post(iVictim, iInflictor, iAttacker, Float:fDamage, bitsDamageType)
  16. {
  17.     if (!is_user_alive(iVictim) || !is_user_alive(iAttacker))
  18.         return PLUGIN_CONTINUE // return HC_CONTINUE
  19.    
  20.     if (get_user_weapon(iAttacker) == CSW_KNIFE))
  21.     {
  22.         SetHookChainArg(4 , ATYPE_FLOAT, fDamage * get_pcvar_float(g_pCvarDamage))
  23.         return PLUGIN_CONTINUE // return HC_CONTINUE
  24.     }
  25.    
  26.     return PLUGIN_CONTINUE // return HC_CONTINUE
  27. }

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#2

Post by sPe3doN » 4 years ago

Image

neverminddw
Member
Member
Posts: 32
Joined: 6 years ago
Contact:

#3

Post by neverminddw » 4 years ago

Forget it. I've solved the problem.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 258
Joined: 7 years ago
Contact:

#4

Post by sPe3doN » 4 years ago

okay
Image

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 2 guests