Quote:
Originally Posted by Napoleon_be
Also, i realized this part:
Code:
Disabling Hooks
Similar to how FakeMeta allows for unregistering of hooks with unregister_forward(), HamSandwich will allow you to disable and enable hooks whenever you want.
The RegisterHam() function will return a handle (tagged with HamHook). You can then make subsequent calls to DisableHamForward() and EnableHamForward() with the handle to stop it from forwarding, or enable its forwards again.
Would this be an option to use? The basic idea is to disable the blood animation whenever damage has been ignored by the same plugin. If so, could someone provide me an example of how i could make this work? In my opinion, this would be the right call.
|
No, disabling and enabling the hook, just stops the hook from calling.
Example:
You hook Ham_Spawn with RegisterHam. In return, you get a unique index for that hook. You can enable or disable that hook if a boolean is true or false.
If the boolean is true, you could enable the hook and at next player spawn it will be called, otherwise, you could disable the hook and at next player spawn it won't be called.
P.S.: It won't stop the function Ham_Spawn from being called, only your hook.
If you didn't understood, I will leave a code example later.
__________________