Raised This Month: $51 Target: $400
 12% 

Can you register_event with SVC_ messages?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 07-03-2016 , 02:48   Can you register_event with SVC_ messages?
Reply With Quote #1

Can you register_event with SVC_ messages like register_message does?
__________________
youtube:
@holla16
11922911 is offline
SpannerSpammer
Member
Join Date: Mar 2006
Old 07-04-2016 , 01:08   Re: Can you register_event with SVC_ messages?
Reply With Quote #2

Use register_message( ), instead, since it requires a message id.
Example; finding room type transitions:
Code:
...
public plugin_init( )
{
    ...
    register_message( SVC_ROOMTYPE, "Msg_RoomType" );
}

public Msg_RoomType( msg_id, msg_dest, msg_entity )
{
    if ( ( msg_id == SVC_ROOMTYPE ) && ( msg_dest == MSG_ONE ) && !is_user_bot( msg_entity ) )
    {
	new iVal = get_msg_arg_int( 1 );
	client_print( msg_entity, print_chat, "RoomType: <%d>^n", iVal );
    }
    return PLUGIN_CONTINUE;
}
What exactly are you tying to hook?
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-04-2016 , 04:38   Re: Can you register_event with SVC_ messages?
Reply With Quote #3

It's possible to use register_event() by passing directly the value, like register_event("42", ...);
__________________
Arkshine is offline
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 13:41.


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