AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Register/Unregister HAM (https://forums.alliedmods.net/showthread.php?t=187486)

Y060N 06-13-2012 18:19

Register/Unregister HAM
 
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.

SpeeDeeR 06-13-2012 18:29

Re: Register/Unregister HAM
 
DisableHamForward()

Y060N 06-13-2012 19:07

Re: Register/Unregister HAM
 
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.

Bugsy 06-13-2012 19:27

Re: Register/Unregister HAM
 
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.

<VeCo> 06-14-2012 06:39

Re: Register/Unregister HAM
 
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...


All times are GMT -4. The time now is 06:11.

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