View Single Post
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 02-29-2008 , 10:38   Re: ActionCS (damage/speed mod for CSS)
Reply With Quote #27

I hook GetMaxSpeed on weapons to change the speeed. It's more complicated, but has a completely different feel than the lagged movement method. I used both in my AWE plugin, one as a speed modifier and the lagged movement as "adrenaline." They had a completely different feel.

The hardest part is keeping track of all the weapons. At first I was hooking them whenever a player picked one up and unhooking it when it was dropped, but I found that it was easier to sigscan for AddListenerEntity and create an entity listener. Now I hook weapons as they are created and unhook them as they are deleted.

Some example code is here. If you are comfortable scanning for functions I can give you the function signatures you need for adding an entity listener. Otherwise it might be easier to hook the player's weapon pickup and drop functions (if you do it that way, keep track of what's hooked and unhooked so you can unhook the weapons at endround that are left because some weapons won't call the player's drop function.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline