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

remove dropped entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 07-25-2008 , 19:40   remove dropped entities
Reply With Quote #1

is there any way to remove dropped weapons and other entities like helmets from the game (DODS)

im thinking of using FindEntityByClassname(startEnt, const String:classname[]);
what are the classnames of helmets, and dropped guns?

or there is a plugin that does this?
DarkEnergy is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-25-2008 , 19:50   Re: remove dropped entities
Reply With Quote #2

You should loop through all the entities with a for loop, get the classname and check if "weapon_" is in the name, then check if m_hOwner is == -1, and then remove.

That should kill all weapons, I don't know the classname of helmets.
__________________
Greyscale is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-26-2008 , 06:14   Re: remove dropped entities
Reply With Quote #3

http://ampaste.net/m6c0a96b7

Only removes weapons though, don't know if it's possible to remove helmets etc. Also not that efficient, but it was written quickly.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Liam
SourceMod Developer
Join Date: Jan 2008
Location: Atlanta, GA
Old 07-26-2008 , 10:57   Re: remove dropped entities
Reply With Quote #4

You should just grab them off of the client as player_death is called and wipe them out that way. May be a bit more efficient?
Liam is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-26-2008 , 10:59   Re: remove dropped entities
Reply With Quote #5

Quote:
Originally Posted by Liam View Post
You should just grab them off of the client as player_death is called and wipe them out that way. May be a bit more efficient?
IIRC weapons are dropped before the death event is sent?
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 07-26-2008 , 12:44   Re: remove dropped entities
Reply With Quote #6

the code is fine, now we need the helmet classname
DarkEnergy is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-26-2008 , 14:20   Re: remove dropped entities
Reply With Quote #7

teame06 wins a cookie! The weapon is already dropped on the player_death event, so you can't get it from the player anymore. As far as I know there's no way to hook when a player switches weapons either. If there was, you could save the entity index of the weapon when they switch, and remove it when they die.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-26-2008 , 18:28   Re: remove dropped entities
Reply With Quote #8

You can hook the "drop" command, and keep track of the weapons they drop, and hook event "item_pickup" to keep track of weapons they pick up
__________________
Greyscale is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-26-2008 , 19:08   Re: remove dropped entities
Reply With Quote #9

I think item_pickup is a CS:S only event, although the equip command might work in DoD:S like it does in TF2.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami 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 15:53.


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