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

[TF2] Help for killing dispensers entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 10-09-2017 , 11:45   [TF2] Help for killing dispensers entities
Reply With Quote #1


Those are the dispensers entities after using spy "recorder".

How to kill those entities after dispenser killed?
__________________
Dr.Doctor is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-11-2017 , 17:02   Re: [TF2] Help for killing dispensers entities
Reply With Quote #2

I'd recommend using OnEntityCreated forward then killing the entity if it matches whatever you don't want.
Halt is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 10-12-2017 , 06:36   Re: [TF2] Help for killing dispensers entities
Reply With Quote #3

Quote:
Originally Posted by Halt View Post
I'd recommend using OnEntityCreated forward then killing the entity if it matches whatever you don't want.
Code:
if(IsValidEntity(iDis))
{
	AcceptEntityInput(iDis, "KillHierarchy");
}
I use that code to kill Dispenser, but it wont work on kill their child
__________________

Last edited by Dr.Doctor; 10-12-2017 at 06:37.
Dr.Doctor is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-12-2017 , 07:30   Re: [TF2] Help for killing dispensers entities
Reply With Quote #4

Can you do this in-game againts bots?
Enable sv_cheats 1

Then use find_ent search:
find_ent dis
find_ent reco
find_ent _

Maybe you find correct classname
__________________
Do not Private Message @me
Bacardi is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-12-2017 , 10:43   Re: [TF2] Help for killing dispensers entities
Reply With Quote #5

Quote:
Originally Posted by Dr.Doctor View Post
Code:
if(IsValidEntity(iDis))
{
	AcceptEntityInput(iDis, "KillHierarchy");
}
I use that code to kill Dispenser, but it wont work on kill their child
Its more than likely a prop then, not the dispenser entity anymore.

models\weapons\w_models\w_toolbox.mdl
models\weapons\c_models\c_toolbox\c_toolbox.m dl
Halt is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-12-2017 , 17:14   Re: [TF2] Help for killing dispensers entities
Reply With Quote #6

Quote:
Originally Posted by Halt View Post
Its more than likely a prop then, not the dispenser entity anymore.

models\weapons\w_models\w_toolbox.mdl
models\weapons\c_models\c_toolbox\c_toolbox.m dl
Not sure if this is still true, but they used to be an ammo box like how dropped weapons used to be. tf_ammo_pack I think.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 10-12-2017 , 22:43   Re: [TF2] Help for killing dispensers entities
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
Not sure if this is still true, but they used to be an ammo box like how dropped weapons used to be. tf_ammo_pack I think.
If thats the case then I'll look more into the entities TF2 has.
Halt is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 10-13-2017 , 08:19   Re: [TF2] Help for killing dispensers entities
Reply With Quote #8

Thanks for reply!

I will test all your method
__________________
Dr.Doctor is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 10-13-2017 , 08:27   Re: [TF2] Help for killing dispensers entities
Reply With Quote #9

Yeah! It works on tf_ammo_pack !!!!!

Code:
int iDisChild= -1; 
while ((iDisChild= FindEntityByClassname(iDisChild, "tf_ammo_pack")) != -1)
{
	AcceptEntityInput(iDisChild, "Kill");
}
Thanks all your suggestions!

__________________
Dr.Doctor is offline
Dr.Doctor
AlliedModders Donor
Join Date: Feb 2017
Location: Hong Kong
Old 10-13-2017 , 09:08   Re: [TF2] Help for killing dispensers entities
Reply With Quote #10

Also, I had checked the "GetEntPropEnt(iEntity, Prop_Send, "m_hOwnerEntity")" of Dispenser child.

It is = -1
__________________
Dr.Doctor 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 19:57.


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