AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Coding MM:S Plugins & SM Extensions (https://forums.alliedmods.net/forumdisplay.php?f=75)
-   -   Can't use CreateMessage in a source:mm plugin.. how? (https://forums.alliedmods.net/showthread.php?t=39202)

Geesu 10-24-2005 22:32

Can't use CreateMessage in a source:mm plugin.. how?
 
I figured I'd give this a shot:

Code:

                KeyValues *kv = new KeyValues( "msg" );
                kv->SetString( "title", "Hello" );
                kv->SetString( "msg", "Hello there" );
                kv->SetColor( "color", Color( 255, 0, 0, 255 ));
                kv->SetInt( "level", 5);
                kv->SetInt( "time", 10);
                m_Helpers->CreateMessage( pEntity, DIALOG_MSG, kv, (IServerPluginCallbacks *) this );
                kv->deleteThis();

Obvsiouly it doesn't work, I should cast this as something its not. But if I don't cast it, then it won't compile.

What do I do to get around this so that I can call this createmessage function?

Thanks,
Josh

sslice 10-24-2005 22:33

hmm... try casting m_ServerDll

Code:

m_Helpers->CreateMessage( pEntity, DIALOG_MSG, kv, (IServerPluginCallbacks *) m_ServerDll );

Geesu 10-24-2005 22:44

tried, server crashed :/

BAILOPAN 10-24-2005 22:50

You must implement the IServerPluginCallbacks class. Make a dummy class that makes stub functions for everything but what you need.

Geesu 10-25-2005 09:47

ok will try that, ty


All times are GMT -4. The time now is 02:19.

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