View Single Post
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