Raised This Month: $51 Target: $400
 12% 

Detect weapon hits an entity (all entities not on clients only)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ojisan
New Member
Join Date: Jan 2024
Old 02-08-2024 , 12:50   Detect weapon hits an entity (all entities not on clients only)
Reply With Quote #1

I just want to detect if a knife hits something. Any entity. Or any weapon hits something. Ontakedamage or traceattack works only if you hit players. Please help me with this. The game is CS:S.
ojisan is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-08-2024 , 22:15   Re: Detect weapon hits an entity (all entities not on clients only)
Reply With Quote #2

You can do by hook OnTakeDamage to entity, and check is attacker player.

To get entities, there is SDKHooks https://sm.alliedmods.net/new-api/sd...nEntityCreated
Hook first with SDKHook_SpawnPost.
Then hook spawned entity with OnTakeDamage
__________________
Do not Private Message @me
Bacardi 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 04:04.


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