Raised This Month: $ Target: $400
 0% 

prevent a Ham registered event from going through


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-04-2014 , 21:01   Re: prevent a Ham registered event from going through
Reply With Quote #3

Quote:
Originally Posted by striker07 View Post
RegisterHam(Ham_TakeDamage, "player", "player_hurt_pre", 1)

as you can see, i hooked Ham_TakeDamage
when this fires and my condition to block the event from continuing its normal proces is met i return HAM_SUPERCEDE.

Unfortunatly this doesnt work and damage still goes through and the player still hits his target.
I need a full stop, how could i do that?
You can't stop a function when you hook it as post (like you are doing). You have to hook it as a prehook (aka post=0 or omit the last argument). So, if you hook it correctly, HAM_SUPERCEDE will work.

Quote:
Originally Posted by matsi View Post
Code:
/**  * Stops a ham forward from triggering.  * Use the return value from RegisterHam as the parameter here!  *  * @param fwd           The forward to stop.  */ native DisableHamForward(HamHook:fwd); /**  * Starts a ham forward back up.  * Use the return value from RegisterHam as the parameter here!  *  * @param fwd           The forward to re-enable.  */ native EnableHamForward(HamHook:fwd);
He doesn't want to disable the forward, he wants to act on the event.
__________________

Last edited by fysiks; 01-04-2014 at 21:03.
fysiks is offline
 



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 10:04.


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