Detecting a Weapon Drop
As the title stated, I'd like to know how I would detect if a player had dropped a weapon.
Furthermore, when this happens, would I be able to set a Pre-Think to this event, to detect the origin of the entity ( weapon )? |
Re: Detecting a Weapon Drop
PHP Code:
|
Re: Detecting a Weapon Drop
You can cache the entity id of each weapon when acquired so it can be used when dropped.
|
Re: Detecting a Weapon Drop
No, that's not even close to what I was looking for.
I want to set up a forward to detect if a player has dropped a weapon. For example, HAM has a forward to detect when a player is killed, takes damage, spawns, etc. I was wondering if there is a forward to detect that with an entity (weapon), and a way to set-up a prethink to find the origin before it is dropped. |
Re: Detecting a Weapon Drop
Quote:
|
Re: Detecting a Weapon Drop
Ham_Item_Drop
You may use Ham_CS_Item_CanDrop inside Ham_Item_Drop callback. Both have to be registered/used with weapons classnames/indexes And to retrieve player, use m_pPlayer weapon offset. |
Re: Detecting a Weapon Drop
Quote:
|
Re: Detecting a Weapon Drop
g_Weapons holds the weapons that you want to monitor being dropped. Remove whichever you don't want or you can eliminate the check all together.
PHP Code:
|
Re: Detecting a Weapon Drop
Quote:
|
Re: Detecting a Weapon Drop
Quote:
You already have a topic for when player is dead so stick to that topic. |
| All times are GMT -4. The time now is 07:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.