AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SVC_INTERMISSION (https://forums.alliedmods.net/showthread.php?t=159640)

FiFiX 06-19-2011 17:25

SVC_INTERMISSION
 
Hello. The problem is with register_message(SVC_INTERMISSION..
While using Galileo(http://forums.alliedmods.net/showthread.php?t=77391) I'm trying to hook this event with another plugin that way:
Code:

register_message(SVC_INTERMISSION, "Message_Intermission");
Of course in Galileo we have:
Code:

message_begin(MSG_ALL, SVC_INTERMISSION);
 message_end();

And the problem is that another plugin can't catch this message.
public Message_Intermission won't load. Any solutions or explanations?

Exolent[jNr] 06-19-2011 17:27

Re: SVC_INTERMISSION
 
Messages sent with message_begin() cannot be hooked.
The message has to be sent with emessage_begin() (and appropriate e*() functions instead of the normal ones) to be hooked.

FiFiX 06-19-2011 17:55

Re: SVC_INTERMISSION
 
Can You give me an example ?

ConnorMcLeod 06-19-2011 17:57

Re: SVC_INTERMISSION
 
emessage_begin(MSG_ALL, SVC_INTERMISSION);
emessage_end();

FiFiX 06-19-2011 18:01

Re: SVC_INTERMISSION
 
Quote:

Originally Posted by Exolent[jNr] (Post 1491761)
and appropriate e*() functions instead of the normal ones)

I meant that part. Sorry.

ConnorMcLeod 06-19-2011 18:06

Re: SVC_INTERMISSION
 
message.inc :

Code:

/* These functinos are used to generate client messages.
 * You may generate menu, smoke, shockwaves, thunderlights,
 * intermission and many many others messages.
 * See HL SDK for more examples. */
native message_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
native message_end();
native write_byte(x);
native write_char(x);
native write_short(x);
native write_long(x);
native write_entity(x);
native write_angle(x);
native write_coord(x);
native write_string(const x[]);

/* These are the same as above, except that the messages sent
 *  are also sent to all other plugins and Metamod plugins.
 * This means that if you send one of these messages, other plugins will
 *  be notified, which was previously impossible. 
 * BE CAREFUL! Using these incorrectly, or not for their intended purpose,
 *  could cause infinite recursion or something just as bad.
 * NOTE! These natives are experimental.
 */
native emessage_begin(dest, msg_type, const origin[3] = {0,0,0}, player = 0);
native emessage_end();
native ewrite_byte(x);
native ewrite_char(x);
native ewrite_short(x);
native ewrite_long(x);
native ewrite_entity(x);
native ewrite_angle(x);
native ewrite_coord(x);
native ewrite_string(const x[]);


FiFiX 06-19-2011 18:15

Re: SVC_INTERMISSION
 
And hook part in other plugin won't change? Am I correct?

FiFiX 06-19-2011 19:06

Re: SVC_INTERMISSION
 
Echm, when I changed it for:
Code:

emessage_begin(MSG_ALL, SVC_INTERMISSION);
emessage_end();

Server dies while map change... Any ideas?

Arkshine 06-19-2011 19:50

Re: SVC_INTERMISSION
 
Same when you disable your "another plugin" ?

FiFiX 06-19-2011 19:52

Re: SVC_INTERMISSION
 
Yes. However if it isn't disabled it works as it should.


All times are GMT -4. The time now is 23:26.

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