Raised This Month: $12 Target: $400
 3% 

Solved [L4D/2] Can Pickup Method "+use"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 08-18-2019 , 13:44   [L4D/2] Can Pickup Method "+use"
Reply With Quote #1

hi all, I would like to know how I could implement an equal or as similar method as possible, to the method that allows to detect if any weapon or item can pickup.
The reason for this implementation is for a plugin that I am trying to do, where it allows items or weapons can pickup, when the survivor is incapacitated. The idea of this is that it looks as much as possible when the survivor is standing, for now I have only tried the GetClientAimTarget method, but this works the same as a laser-looking one, so if the player does not point well at the item, he can't pick it up ... :/
https://imgur.com/9yjUzTO
pd: sorry for me bad english :c

Last edited by xZk; 08-20-2019 at 15:13.
xZk is offline
Lux
Veteran Member
Join Date: Jan 2015
Location: Cat
Old 08-19-2019 , 06:03   Re: [L4D/2] Can Pickup Method "+use"
Reply With Quote #2

I think that is blocked clientsided like open and closing doors.

You can try using SDKHooks SDKHook_Use and hooking entities you want to pickup and filter accordingly.

https://sm.alliedmods.net/new-api/sdkhooks
__________________
Connect
My Plugins: KlickME
[My GitHub]

Commission me for L4D
Lux is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 08-19-2019 , 13:07   Re: [L4D/2] Can Pickup Method "+use"
Reply With Quote #3

thanks for your answer Lux. Yes, you are right, the Use method is blocked when the survivor is incapacitated :C. Another option I was thinking is to remove the incapacity through a SetProp when the player presses the E key, but still need a method to detect if the item is in the correct range so that it can be picked up... :/

Last edited by xZk; 08-19-2019 at 13:09.
xZk is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 08-20-2019 , 05:07   Re: [L4D/2] Can Pickup Method "+use"
Reply With Quote #4

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

Or

https://forums.alliedmods.net/showpo...8&postcount=69
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 08-20-2019 at 05:10.
Dragokas is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 08-20-2019 , 15:11   Re: [L4D/2] Can Pickup Method "+use"
Reply With Quote #5

It's not perfect, but it works great , I'll leave the code in case someone else needs it.
Thanks so much Dragokas
Spoiler
xZk is offline
Reply


Thread Tools
Display Modes

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 09:46.


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