Raised This Month: $ Target: $400
 0% 

Hooking weapon remove


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-22-2010 , 13:33   Hooking weapon remove
Reply With Quote #1

How to hook when some specified weapon( i.e. galil ) is removed from players inventory, in this case I need when player drops weapon ? I tried to use Ham_Item_Kill, but it seems that it isnt called in this situation.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-22-2010 , 13:44   Re: Hooking weapon remove
Reply With Quote #2

Drop by command ? death ?
__________________

Last edited by Arkshine; 10-22-2010 at 13:51.
Arkshine is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 10-22-2010 , 13:50   Re: Hooking weapon remove
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Drop by command ? death ?
Drop by command.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-22-2010 , 13:51   Re: Hooking weapon remove
Reply With Quote #4

Simply hook "drop"
__________________
Arkshine is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 10-24-2010 , 18:10   Re: Hooking weapon remove
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
Simply hook "drop"
Yes, but if u want it to be more powerful and more hard to make use orpheu
__________________
okay
ARES[ro] is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-24-2010 , 18:11   Re: Hooking weapon remove
Reply With Quote #6

Quote:
Originally Posted by ARES[ro] View Post
Yes, but if u want it to be more powerful and more hard to make use orpheu
Umm, no. Just because it uses Orpheu doesn't make it better.
It makes it uselessly inefficient because hooking "drop" is all that is needed.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 10-24-2010 , 18:17   Re: Hooking weapon remove
Reply With Quote #7

Quote:
Originally Posted by Exolent[jNr] View Post
Umm, no. Just because it uses Orpheu doesn't make it better.
It makes it uselessly inefficient because hooking "drop" is all that is needed.
Yes indeed i was just being off topic its Arkshines fav module
__________________
okay
ARES[ro] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-24-2010 , 18:22   Re: Hooking weapon remove
Reply With Quote #8

Well, for sure, it would be more complicated, because "drop" command calls CBasePlayer:: DropPlayerItem() but this function is used in severals others functions, so using orpheu you would need either to filter the functions, either to hook ClientCommand() and filter the arguments. At the end, hooking "drop" is the simplest way and fits perfectly to the need here. ;)
__________________
Arkshine is offline
ARES[ro]
Senior Member
Join Date: Apr 2010
Old 10-24-2010 , 18:34   Re: Hooking weapon remove
Reply With Quote #9

Quote:
Originally Posted by Arkshine View Post
Well, for sure, it would be more complicated, because "drop" command calls CBasePlayer:: DropPlayerItem() but this function is used in severals others functions, so using orpheu you would need either to filter the functions, either to hook ClientCommand() and filter the arguments. At the end, hooking "drop" is the simplest way and fits perfectly to the need here. ;)
Yes of course, i couldnt agree more (i actly never disagreed) but it would be more safe IMO to hook using either Ham_RemovePlayerItem or Ham_Item_Drop . The reason why i stated that is in case there is an other plugin that uses method to drop players weapons other than client_cmd(id, "drop") maybe calling ham or something.
__________________
okay
ARES[ro] is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-24-2010 , 19:42   Re: Hooking weapon remove
Reply With Quote #10

If a plugin blocks the "drop" command using PLUGIN_HANDLED (instead of PLUGIN_MAIN_HANDLED), it means it's the plugin which is badly coded and that's not my fault. :p . Well, if you are crazy, you could still hook directly amxx with orpheu. ;)
__________________
Arkshine 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:34.


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