Raised This Month: $ Target: $400
 0% 

Unregister_message within the function callback


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-01-2022 , 22:59   Unregister_message within the function callback
Reply With Quote #1

I am hooking user msg ClCorpse and unhooking it through the function callback but i am having an issue afterwards with hooking the function, the question is, is it safe to unhook message handler inside the function callback or outside?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-01-2022 at 23:00.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-02-2022 , 03:45   Re: Unregister_message within the function callback
Reply With Quote #2

What issue are you having?

I vaguely remember a few years ago I reported a crash to Arkshine when using unregister_message inside the message hook directly. I think it was fixed, but as I said, it was a long time ago so I don't properly remember.
So, are you using 1.8.2? If so, try delaying the unregister_message call with a 0.1 task.
__________________
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-02-2022 , 16:51   Re: Unregister_message within the function callback
Reply With Quote #3

I am using
AMX Mod X 1.10.0.5417

When i am unregistering a message out side the function callback i get alot of crashes, no idea why, but i think it might to do with unregistering the message while execution which ruins the iteration, and makes an infinite loop or somthing.

but if i use the unregistering_message within the callback function of register_message the crashes goes away they stop.

But if i use it that way, i get an issues of the hook not being hooked even tho i hooked it, the function callback gets called one time then it stops getting called. WHY? that's what i am trying to figure it out.


Also can you inform me what is m_Forwards max size?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-02-2022 at 18:01.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-04-2022 , 13:51   Re: Unregister_message within the function callback
Reply With Quote #4

Bunp
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 21:22.


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