This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[TF2] Disable Heavy picking up own Sandvich


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trotim
Junior Member
Join Date: Mar 2011
Old 03-12-2011 , 09:12   [TF2] Disable Heavy picking up own Sandvich
Reply With Quote #1

I'd like to know if there's a simple way to disable Heavies from picking up their own thrown Sandvich/Steak.

All I know is that M2 throws a medium health kit entity, but is there an easy way to exclude the thrower from activating it? There is a team filter but what about single players?
Trotim is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-12-2011 , 10:21   Re: [TF2] Disable Heavy picking up own Sandvich
Reply With Quote #2

You can do this with SDKHooks 2.

Use the OnEntityCreated fwd to catch medium health kit creation and hook the spawn of it (creation is too early to check model).

In the spawn hook, check the model to see if it's a sandvich or steak and hook StartTouch and Touch on it if so.

In the StartTouch and Touch, return Plugin_Handled if "entity"'s m_hOwnerEntity = "other". (this is the part that requires SDK Hooks 2. Start/Touch weren't previously blockable.
psychonic is offline
Thrawn2
Veteran Member
Join Date: Apr 2009
Old 03-12-2011 , 12:42   Re: [TF2] Disable Heavy picking up own Sandvich
Reply With Quote #3

done.
https://forums.alliedmods.net/showthread.php?p=1432114
__________________
einmal mit profis arbeiten. einmal.
Thrawn2 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 20:26.


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