Multiply slash damage by two
How would you do this? I thought about checking if the weapon is knife and damage before hooking is 15 but that feels a little bit uncool. Ham_TakeDamage would be greatly appreciated as I already use it.
|
Re: Multiply slash damage by two
hook Ham_TakeDamage as pre
Check that the attacker's weapon is CSW_KNIFE (or 29) inside that.... PHP Code:
|
Re: Multiply slash damage by two
Read the topic name again please.
|
Re: Multiply slash damage by two
There is a plugin that measures slash and stab distances separately.
You should take a look at that code and see if it helps you. I think it's Knife Distance by SchlumPF. |
Re: Multiply slash damage by two
oh.:oops: sorry
PHP Code:
Quote:
Or you can check to see if the weapon is under primary, or secondary operations (left or right click) but i don't know that at the top off my head. Or at all.... |
Re: Multiply slash damage by two
It checks for the pressed button via pev_button. I'm going to try using that.
If anyone knows it won't work in TakeDamage, please tell me so I can save some headaches :D |
Re: Multiply slash damage by two
Quote:
Quote:
|
Re: Multiply slash damage by two
You can see in cssdk : http://code.google.com/p/cs-sdk/sour.../wpn_knife.cpp
that on slah, pre-damage passed is 15.0 or 20.0, and on stab, damage is 65.0 (or 65.0 * 3.0) PHP Code:
|
Re: Multiply slash damage by two
I said I could check the damage in the first post, but it may cause problems if any plugin modifies the damage and is loaded before this one. While I take this as a second method, I'll still try using pev_button first as it may be a better solution if it works.
|
Re: Multiply slash damage by two
I can confirm that pev_button works flawlessly.
|
| All times are GMT -4. The time now is 06:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.