AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Solved Protobuf Usermessages (https://forums.alliedmods.net/showthread.php?t=315569)

TheDS1337 04-13-2019 18:59

Protobuf Usermessages
 
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


All times are GMT -4. The time now is 11:47.

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