• Any way to detect when a view punch has happened?
    4 replies, posted
Google didn't help. And testing for the IN_ATTACK enumeration wont work in my instance. I need to be able to find out the numbers/forces applied by the view punch when it happens. I checked, and there doesn't seem to be any sort of hook or something for this. :/ Any one know of a way to do this?
There isn't a hook but you can get the view punch angles via this function: [url]http://wiki.garrysmod.com/page/Player/GetViewPunchAngles[/url]
[QUOTE=Robotboy655;52198806]There isn't a hook but you can get the view punch angles via this function: [url]http://wiki.garrysmod.com/page/Player/GetViewPunchAngles[/url][/QUOTE] Right. Not exactly what I wanted but you gave me a different idea that might work. Thanks man. :) Wait question though. Does this need to be called the moment a view punch happens? Because I have this running in a HUDPaint hook and it's returning Angle( 0, 0, 0 ) constantly. [editline]7th May 2017[/editline] Nevermind that last bit. Error on my behalf. Works fine in a HUDPaint hook.
You could detour the functions that apply it and make a note of when they punch player's view angles and for how much. This wouldn't work with HL2 weapons though.
[QUOTE=>>oubliette<<;52198915]You could detour the functions that apply it and make a note of when they punch player's view angles and for how much. This wouldn't work with HL2 weapons though.[/QUOTE] You can just test between Move hook calls. FinishMove will return the post-decay value.
Sorry, you need to Log In to post a reply to this thread.