Raised This Month: $32 Target: $400
 8% 

Solved [CSGO] knife kick event or smth


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 11-26-2018 , 12:06   [CSGO] knife kick event or smth
Reply With Quote #1

Is it possible to 'catch' or hook event when player tries to attack with a knife? Doesnt matter if he hits wall or entity or just nothing.

Everything I'm trying to do is increase attack range of melee weapon.

Last edited by impossible_cc; 12-03-2018 at 05:50.
impossible_cc is offline
LenHard
Senior Member
Join Date: Jan 2016
Old 11-27-2018 , 07:15   Re: [CSGO] knife kick event or smth
Reply With Quote #2

weapon_fire event is probably what you're looking for as in for the attacking wise (However it doesn't register with stabbing). You could try to detect if the player has a knife and check if he tries to stab and go on from there. Then using traceray to identify the enemy's distance and emitting damage on the victim with SDKHooks. That's one way to do it, probably could find an alternative.
__________________
LenHard is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 11-27-2018 , 09:36   Re: [CSGO] knife kick event or smth
Reply With Quote #3

Quote:
Originally Posted by LenHard View Post
weapon_fire event is probably what you're looking for as in for the attacking wise (However it doesn't register with stabbing). You could try to detect if the player has a knife and check if he tries to stab and go on from there. Then using traceray to identify the enemy's distance and emitting damage on the victim with SDKHooks. That's one way to do it, probably could find an alternative.
Thx, I'll try it
impossible_cc is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 11-27-2018 , 09:51   Re: [CSGO] knife kick event or smth
Reply With Quote #4

There is one problem. If you do hard attack (right click attack) it doesnt trigger at all.
impossible_cc is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 11-27-2018 , 14:45   Re: [CSGO] knife kick event or smth
Reply With Quote #5

Quote:
Originally Posted by LenHard View Post
weapon_fire event is probably what you're looking for as in for the attacking wise (However it doesn't register with stabbing). You could try to detect if the player has a knife and check if he tries to stab and go on from there. Then using traceray to identify the enemy's distance and emitting damage on the victim with SDKHooks. That's one way to do it, probably could find an alternative.
Anyways it works well. Thx

Last edited by impossible_cc; 11-27-2018 at 14:45.
impossible_cc is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 11-27-2018 , 21:52   Re: [CSGO] knife kick event or smth
Reply With Quote #6

Quote:
Originally Posted by impossible_cc View Post
There is one problem. If you do hard attack (right click attack) it doesnt trigger at all.
Try looking at SDKHook_TraceAttack?

Another option, though I wouldnt recommend itdue to being much more processing, would be to check in OnPlayerRunCmd to see if they are hitting either attack button and proceed from there...the weapon_fire event or SDKHook_TraceAttack hook is much less CPU impact I believe.
__________________
ThatOneGuy is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 11-29-2018 , 14:39   Re: [CSGO] knife kick event or smth
Reply With Quote #7

Quote:
Originally Posted by ThatOneGuy View Post
Try looking at SDKHook_TraceAttack?

Another option, though I wouldnt recommend itdue to being much more processing, would be to check in OnPlayerRunCmd to see if they are hitting either attack button and proceed from there...the weapon_fire event or SDKHook_TraceAttack hook is much less CPU impact I believe.
weapon_fire works satisfactorily, because knife has constant damage, so there isnt any sense to attack with rightclick. Everyone uses leftclick.
impossible_cc is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode