View Single Post
MasterMind420
BANNED
Join Date: Nov 2010
Old 11-02-2017 , 10:45   Re: OnWeaponUse Issue
Reply With Quote #9

Quote:
Originally Posted by Mitchell View Post
I see you like to live dangerously.. Even if you checked to see if the entity had "weapon_" at the beginning I would advise against hooking ever weapon entity like this. Do what Barcadi said, just hook the player's OnWeaponCanUse and just ignore the pickup. Obviously removing the weapon can be stripped out of the code.
I love living dangerously lol...but besides that i still fail to see how hooking every entity would be an issue if he properly implements blocking items/weapons he wants to pickup from being hooked. I've experimented with every method of blocking weapon pickup in L4D2...This method works flawlessly if implemented correctly...However, depending on what game he's doing this for there may be unforeseen issues that i'm unaware of but in L4D2 it works better than using any of the OnWeaponCanUse hooks trying to block weapon pickup...i've experienced issues with trying to block weapon pickup that way. OnWeaponCanUse also effects the weapons u are already carrying, preventing u from using them if you have blocked them this way. Which for him would be a none issue. He could also use OnPlayerRunCmd to block weapon pickup blocking IN_USE for specific weapons.
MasterMind420 is offline