Raised This Month: $32 Target: $400
 8% 

Prevent pickup and equip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LighterSiu
Junior Member
Join Date: Jan 2017
Old 02-04-2017 , 22:19   Prevent pickup and equip
Reply With Quote #1

What im thinking is hooking events: item_pickup & item_equip.

https://wiki.alliedmods.net/Counter-...ts#item_pickup

but it says Every time an item is picked up (generally weapons), so which means its a post event and it can't change to pre?

Inaddition, there is a event called item_equip, but i tried to hook it and block it, it doesnt work... instead of doing this.

https://forums.alliedmods.net/showthread.php?t=111058

I try this event because the method that thread mentions is not quite suitable for me, because that method will let the player pick up weapons and remove it without removing the entity, which means the server console keep spamming entity error... what can i do?

Sorry for my bad explanation.

Last edited by LighterSiu; 02-04-2017 at 22:40.
LighterSiu is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-04-2017 , 22:32   Re: Prevent pickup and equip
Reply With Quote #2

SDKHook_WeaponCanUse is what you searching for.

https://github.com/search?l=SourcePa...utf8=%E2%9C%93
__________________
coding & free software
shanapu is offline
LighterSiu
Junior Member
Join Date: Jan 2017
Old 02-04-2017 , 22:38   Re: Prevent pickup and equip
Reply With Quote #3

Quote:
Originally Posted by shanapu View Post
SDKHook_WeaponCanUse is what you searching for.

https://github.com/search?l=SourcePa...utf8=%E2%9C%93
Thank you! but is SDKHook the only way to block pickup and equip?
LighterSiu is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-05-2017 , 20:56   Re: Prevent pickup and equip
Reply With Quote #4

Quote:
Originally Posted by LighterSiu View Post
Thank you! but is SDKHook the only way to block pickup and equip?
the only way I know. And used in all plugins I seen so far.
__________________
coding & free software
shanapu is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-06-2017 , 03:43   Re: Prevent pickup and equip
Reply With Quote #5

Quote:
Originally Posted by LighterSiu View Post
Thank you! but is SDKHook the only way to block pickup and equip?
They are called events because they have already happened and it's a notification to the server and reset of the players that it happened. You can hook the pre of the event, however in most cases the event has already happened on the client's screen.
Mitchell is offline
LighterSiu
Junior Member
Join Date: Jan 2017
Old 02-06-2017 , 07:03   Re: Prevent pickup and equip
Reply With Quote #6

Quote:
Originally Posted by shanapu View Post
the only way I know. And used in all plugins I seen so far.
Quote:
Originally Posted by Mitchell View Post
They are called events because they have already happened and it's a notification to the server and reset of the players that it happened. You can hook the pre of the event, however in most cases the event has already happened on the client's screen.
oic, thanks!

Last edited by LighterSiu; 02-06-2017 at 07:04.
LighterSiu 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 22:42.


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