Need a hook on secondary fire shotgun
I've been searching for something like this for ages. It's for the Vampire-Slayer mod. The secondary fire on fatherD's slot3 shotgun is way overpowered and considered very lame to use. This ofcourse doesn't stop ppl from doing so even when it's included in the server rules.
That's why I need a way to hook this so a punishment can be given. A way to block it or make it do a normal shot would even be better but I guess that's going to be extremely hard. A hook when doing damage with it would actually be enough. I know how to get one when doing damage with that shotgun but it makes not difference between primary or secondary fire. I hope to find somebody with enough knowledge to help me :) |
Re: Need a hook on secondary fire shotgun
Here is one way you could do it. I made this example for usp but you can make it work with any gun by replacing the classname. There is a cvar [bsa_forceprimary] that if enabled [1] will force primary attack if secondary attack is clicked; when disabled the secondary attack will just be blocked.
With this method, when primary attack is forced you will not see the weapon animation when it occurs but it will still occur. Compile\install this code and use secondary attack with usp to see what I mean. Your ammo will go down with each attack but you will not see the weapon fire. PHP Code:
|
Re: Need a hook on secondary fire shotgun
Thank you for the fast and helpful reply.
There are a few problems though. This line doesn't work at all, so I had to change it to an engine version of it. PHP Code:
PHP Code:
It's very helpful anyway but having the ability to block it would be nice. Also, I do not understand these 2 lines: PHP Code:
|
Re: Need a hook on secondary fire shotgun
You cannot block the secondary-attack animation though the actual workings of the secondary attack are blocked. Try it with the usp, you will see the silencer being applied but it really doesn't get put on once the animation completes.
This line sets primary attack bits in the buttons bit-field if you have the cvar enabled for force primary attack. If you are unfamiliar with bit operators, do a quick google search and you will find plenty of reading material. PHP Code:
PHP Code:
|
Re: Need a hook on secondary fire shotgun
Bugsy you used a cs offset, there's no 2nd attack on cs shotguns, i guess this is for HL.
|
| All times are GMT -4. The time now is 15:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.