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