Raised This Month: $ Target: $400
 0% 

Disable blood animation.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 09-20-2021 , 19:38   Re: Disable blood animation.
Reply With Quote #1

Quote:
Originally Posted by Shadows Adi View Post
You switched the return values:

Code:
public PreDisableBlood(id) {     if(g_bUnderstabbed[id])     {         client_print(0, print_chat, "Disable blood animation");         SetHamReturnInteger(-1);         g_bUnderstabbed[id] = false;         return HAM_HANDLED;     }     return HAM_SUPERCEDE; }

Code:
public PreDisableBlood(id) {     if(g_bUnderstabbed[id])     {         client_print(0, print_chat, "Disable blood animation");         SetHamReturnInteger(-1);         g_bUnderstabbed[id] = false;         return HAM_SUPERCEDE;     }     return HAM_IGNORE; }
Thanks, i'll try this tomorrow. I misread some things on the wiki.

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.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 09-21-2021 , 07:31   Re: Disable blood animation.
Reply With Quote #2

Quote:
Originally Posted by Napoleon_be View Post
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.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi 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 11:40.


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