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

[CS:GO] Blocking weapon drop unless swapping.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Advokat
Member
Join Date: Mar 2014
Location: Australia
Old 10-06-2015 , 00:19   [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #1

Currently I'm trying to block dropping of weapons except in the case that a player uses the "Use key" to acquire a weapon.

Example image:
Spoiler


I was just struggling to find a way to check for this. Currently I use the CS_OnCSWeaponDrop forward and return Plugin_Stop however I'm not sure if there exists a forward to check what weapon will be picked up upon switch. If anyone had a suggestion or a better way to handle this I'd be very grateful.

Last edited by Advokat; 10-06-2015 at 00:21.
Advokat is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 10-06-2015 , 00:32   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #2

Check if the client is using the USE key when they pick up a weapon?

EDIT: and looking at the weapon

Last edited by Addicted.; 10-06-2015 at 00:33. Reason: forgot
Addicted. is offline
Advokat
Member
Join Date: Mar 2014
Location: Australia
Old 10-06-2015 , 01:09   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #3

Mm, I had considered that as an option. It's a bit too clunky for what I'm trying to do, I think. Appreciate the suggestion all the same though, thank you. Ideally, if there isn't a forward for it currently we'd probably be well served by one. I think TF2 has a weapon switch feature as well now.
Advokat is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-06-2015 , 12:10   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #4

SDKHooks OnWeaponCanUse or something another. Also there is a server convar to prevent dropping weapons. It's mainly used in gg and dm, however I use it in a few of my custom gamemodes. (it also prevents weapon dropping when the player dies.)
Mitchell is offline
Advokat
Member
Join Date: Mar 2014
Location: Australia
Old 10-08-2015 , 13:00   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #5

That does allow me to block certain weapons from being picked up however I'm looking to block dropping weapons all-together unless they're switching it for another weapon and I don't seem to be able to find a hook that returns both weapons in the exchange. There's quite likely not a clean way of doing this, it seems.

Last edited by Advokat; 10-08-2015 at 23:45.
Advokat is offline
TonyBaretta
Senior Member
Join Date: Mar 2014
Location: nope.avi
Old 10-09-2015 , 06:44   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #6

this "SDKHook_WeaponDrop" block only drop not pickup by "E" if can help .

edit : check here https://forums.alliedmods.net/showthread.php?t=271450
__________________

Last edited by TonyBaretta; 10-09-2015 at 07:09.
TonyBaretta is offline
Advokat
Member
Join Date: Mar 2014
Location: Australia
Old 10-10-2015 , 04:53   Re: [CS:GO] Blocking weapon drop unless swapping.
Reply With Quote #7

The downside to that would be they'd be able drop a weapon without switching - as long as they're holding Use (if I'm reading it right). Thanks, though. It's one way to do a sort of check.

Last edited by Advokat; 10-10-2015 at 04:57.
Advokat 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 11:51.


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