Raised This Month: $7 Target: $400
 1% 

Solved Protobuf Usermessages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 04-13-2019 , 18:59   Protobuf Usermessages
Reply With Quote #1

Hey guys, I'm having some difficulties compiling a Screenfade usermsg, I'm using SM's built-in UM Interface so it should work without any problems but I'm getting unresolved external symbols errors.... I linked everything necessary from the CS:GO HL2SDK, even the .lib file so I'm really confused to why it is not working.. I'm using this code:

Code:
void ScreenFade(int client, int duration, int holdTime, int flags, Color color)
{
	static int msgId = -1;

	if( msgId == -1 )
	{
		msgId = usermsgs->GetMessageIndex("Fade");
	}

	CCSUsrMsg_Fade *msg = (CCSUsrMsg_Fade *) usermsgs->StartProtobufMessage(msgId, &client, 1, USERMSG_BLOCKHOOKS);

	if( msg )
	{
		msg->set_duration(duration);
		msg->set_hold_time(holdTime);
		msg->set_flags(flags);

/* 
		This causes external linkage errors, need to find a way to compile it
		static CMsgRGBA *typedColor = new CMsgRGBA;

		if( typedColor )
		{
			typedColor->set_r(color.r());
			typedColor->set_g(color.g());
			typedColor->set_b(color.b());
			typedColor->set_a(color.a());

			msg->set_allocated_clr(typedColor);
		}
*/				
		usermsgs->EndMessage();
	}
}
At first, I tried with mutable_clr just like one of SM's UM here: https://github.com/alliedmodders/sou...dtext.cpp#L319

EDIT:
I'm building as "Debug" on MSVC 2017

Last edited by TheDS1337; 04-14-2019 at 03:26. Reason: Solved, just recompiled the library with the needed toolset
TheDS1337 is offline
Reply


Thread Tools
Display Modes

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 23:55.


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