Weapon "donation"
I'm trying to think of a way this could be done. By donation, I simply mean when a player drops their weapon and another one picks it up (from the same team).
I thought about hooking weapon pickup, checking the weapon's owner and compare teams with the player picking the weapon. I cannot find a proper hook for this though - I'm sure hooking WeapPickUp event would be too late, as the weapon's owner would already be overwritten. Ham with pre hook could work, but I've had problems with Ham_AddPlayerItem and I cannot see any other Ham hook for this. Thanks in advance. Edit: I need the index of the donator. |
Re: Weapon "donation"
client cmd -> drop
called before user drop weapon entity. |
Re: Weapon "donation"
what
learn something new every day |
Re: Weapon "donation"
just check war3ft plugin, that hook what weapon dropped, and who drop them. after that you can hook weapon pickup with the same way, and check...
|
Re: Weapon "donation"
You can save weapon owner when weapon is added into weaponbox (BOOL CWeaponBox::PackWeapon( CBasePlayerItem *pWeapon )) but you can only hook this function with rage or orpheu.
During this function, weapon's owner is changed from player to weaponbox, you could use some pev->euserX to store previous owner. About weaponbox Touch, you can retrieve weapons indexes with pdata. Needed pdatas here : http://forums.alliedmods.net/showthr...01#post1712101 When you have retrieved 'weapon', just check pev(weapon, pev_euser1) for example, don't forget to check if touching player is able to pickup that weapon first.
Spoiler
|
| All times are GMT -4. The time now is 13:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.