AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   register message vs event (https://forums.alliedmods.net/showthread.php?t=339156)

MrPickles 08-19-2022 22:42

register message vs event
 
Hello! I have a doubt, which is better to use, register event or message, thinking that it will be called several times in short intervals, there are times when the same event or message share a name and both can be used, but what is it? faster and more efficient?, for modding is better to use message i think, cause u can edit the message ints/coords/string etc, if i wanna add an extra effect i need to use event? thanks!

fysiks 08-20-2022 01:30

Re: register message vs event
 
Use the one that does what you need it to do. It is highly unlikely that there will be any appreciable difference in performance. If you find that when you implement it and it's causing issues then re-examine then.

Such broad and generic questions don't generally get good responses. It's better if you ask specifically about something you're trying to do.

MrPickles 08-20-2022 02:29

Re: register message vs event
 
Quote:

Originally Posted by fysiks (Post 2786943)
Use the one that does what you need it to do. It is highly unlikely that there will be any appreciable difference in performance. If you find that when you implement it and it's causing issues then re-examine then.

Such broad and generic questions don't generally get good responses. It's better if you ask specifically about something you're trying to do.

i said it

Quote:

for modding is better to use message i think, cause u can edit the message ints/coords/string etc, if i wanna add an extra effect i need to use event? thanks!
It's more of a doubt than a specific question.

HamletEagle 08-20-2022 09:01

Re: register message vs event
 
Events are hooked as post, you can not block or alter the event.
Messages are hooked as pre, it allows you to block/alter the message.

That's all there is to it. Pick the one that does what you need.
This is not a question about efficiency or performance.

MrPickles 08-20-2022 16:01

Re: register message vs event
 
Quote:

Originally Posted by HamletEagle (Post 2786967)
Events are hooked as post, you can not block or alter the event.
Messages are hooked as pre, it allows you to block/alter the message.

That's all there is to it. Pick the one that does what you need.
This is not a question about efficiency or performance.

thanksss


All times are GMT -4. The time now is 15:37.

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