AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking Messages doubt (https://forums.alliedmods.net/showthread.php?t=133329)

Alucard^ 07-24-2010 08:29

Blocking Messages doubt
 
Simple question, expresed in the code:

Code:
new gMsgShowMenu; public plugin_init() {     gMsgShowMenu = get_user_msgid("ShowMenu");     set_msg_block(gMsgShowMenu, BLOCK_SET);         register_message(gMsgShowMenu, "MessageShowMenu"); } public MessageShowMenu(msgid, dest, id) {     // the code here will be executed?     // Or not, becouse the msg is blocked? }

Or i have to put a return PLUGIN_HANDLED to block it and before that add the code that i want?

Hunter-Digital 07-24-2010 09:15

Re: Blocking Messages doubt
 
You could just test it, change the message to SayText, add a message in hook and type something in-game.
It's not that hard and it won't take more than a few minutes.

Alucard^ 07-24-2010 10:30

Re: Blocking Messages doubt
 
Ye i know but, i posted becouse i can't test now.

That i want to know is what means "block" in this case... means that complete block the messages and cannot be registered or block the message send by the game but you can register it.

Sry for my english.

Hunter-Digital 07-25-2010 09:44

Re: Blocking Messages doubt
 
Ok just tested it, it's blocked completly, the registered function doesn't trigger.

ConnorMcLeod 07-25-2010 10:15

Re: Blocking Messages doubt
 
That message wont ever be sent to players.
But MessageShowMenu callcack can be called.

You should just log something into the callback or look at amxx sources to know if function gonna be executed (register_message and registered_event).
Then if you need to catch specific messages/events you should use register_event.


All times are GMT -4. The time now is 00:11.

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