Raised This Month: $ Target: $400
 0% 

Weapon "donation"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-17-2013 , 17:23   Weapon "donation"
Reply With Quote #1

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.

Last edited by Backstabnoob; 01-17-2013 at 17:37.
Backstabnoob is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-17-2013 , 17:26   Re: Weapon "donation"
Reply With Quote #2

client cmd -> drop
called before user drop weapon entity.
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-17-2013 , 17:34   Re: Weapon "donation"
Reply With Quote #3

what


learn something new every day

Last edited by Backstabnoob; 01-17-2013 at 17:35.
Backstabnoob is offline
AngeIII
Senior Member
Join Date: Sep 2007
Location: Latvia
Old 01-17-2013 , 18:41   Re: Weapon "donation"
Reply With Quote #4

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...
__________________
skype: pavle_ivanof
-=ThQ=-
PRIVATE SUPPORT = PAID SUPPORT
AngeIII is offline
Send a message via Skype™ to AngeIII
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-18-2013 , 00:53   Re: Weapon "donation"
Reply With Quote #5

You can save weapon owner when weapon is added into weaponbox (BOOL CWeaponBox:ackWeapon( 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
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-18-2013 at 00:56.
ConnorMcLeod 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 13:39.


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