Raised This Month: $ Target: $400
 0% 

[SOLVED][L4D2] Kill weapon entity unless picked up


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cigs
Senior Member
Join Date: Jul 2006
Old 02-18-2010 , 08:17   [SOLVED][L4D2] Kill weapon entity unless picked up
Reply With Quote #1

The following code compiles correctly and I have tried several things, but I can't seem to manage what I want.

It's code to remove dropped weapons unless it gets picked up again.

=> http://swiftreal.ampaste.net/f21cbecc2

When I give myself 4 weapons, 3 weapons drop on the ground and I'm left with the last weapon I given. That last weapon is not being dropped so it stays in my hands.
But, when I then pick up one of the dropped weapons it not only kills all the dropped weapons on the ground (after 15 seconds) but also kills the one I just picked up.
__________________

Last edited by cigs; 02-18-2010 at 16:11. Reason: add [SOLVED] to title
cigs is offline
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 02-18-2010 , 08:27   Re: Kill weapon entity unless picked up
Reply With Quote #2

after the 15 seconds and before you remove the weapons check if they have an owner, use the "m_hOwner" offset.
blodia is offline
cigs
Senior Member
Join Date: Jul 2006
Old 02-18-2010 , 08:37   [SOLVED] Kill weapon entity unless picked up
Reply With Quote #3

Figured out how.

=> http://swiftreal.ampaste.net/f282d1224

Thanks for the tip!
__________________

Last edited by cigs; 02-18-2010 at 09:15. Reason: SOLVED
cigs 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 07:05.


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