Raised This Month: $ Target: $400
 0% 

Register/Unregister HAM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 06-13-2012 , 18:19   Register/Unregister HAM
Reply With Quote #1

On one of my servers, I run a big plugin that hooks reload, primary attack, primary attack post, and take damage. I was wondering if it's possible to not even look at those if they don't have certain skills (unregister the HAM hook if they do not have a certain skill, per player basis).

It seems that a lot of data is being sent to them even if they are lower level or level 0, since it's hooking their attacks for everything. I do check for their levels right at the beginning, but I'd prefer it to not even have to check (or only check once) if it could be done.
Y060N is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-13-2012 , 18:29   Re: Register/Unregister HAM
Reply With Quote #2

DisableHamForward()
SpeeDeeR is offline
Y060N
BANNED
Join Date: Dec 2011
Location: www.equilibriumcs.com
Old 06-13-2012 , 19:07   Re: Register/Unregister HAM
Reply With Quote #3

Right I know that, but will it not disable the forward alltogether? I still want people with the skills to be hooked, but if they don't have the skills to not bother with the forwards.
Y060N is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-13-2012 , 19:27   Re: Register/Unregister HAM
Reply With Quote #4

You hook an entire entity class (not a single player) when you register a ham forward, so the answer is no. Maybe use a bit-field to store which players have what and check that first in the forward.
__________________

Last edited by Bugsy; 06-13-2012 at 19:36.
Bugsy is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-14-2012 , 06:39   Re: Register/Unregister HAM
Reply With Quote #5

Will RegisterHamFromEntity work? As checking the skills in putinserver and enable it if they have the needed level.

EDIT: Ah, yes... it is hooked for all entities of the provided class... won't wok...
__________________

Last edited by <VeCo>; 06-14-2012 at 06:41.
<VeCo> 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 06:11.


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