Raised This Month: $12 Target: $400
 3% 

Can't use CreateMessage in a source:mm plugin.. how?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-24-2005 , 22:32   Can't use CreateMessage in a source:mm plugin.. how?
Reply With Quote #1

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
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 10-24-2005 , 22:33  
Reply With Quote #2

hmm... try casting m_ServerDll

Code:
m_Helpers->CreateMessage( pEntity, DIALOG_MSG, kv, (IServerPluginCallbacks *) m_ServerDll );
__________________
sslice is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-24-2005 , 22:44  
Reply With Quote #3

tried, server crashed :/
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
BAILOPAN
Join Date: Jan 2004
Old 10-24-2005 , 22:50  
Reply With Quote #4

You must implement the IServerPluginCallbacks class. Make a dummy class that makes stub functions for everything but what you need.
__________________
egg
BAILOPAN is offline
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-25-2005 , 09:47  
Reply With Quote #5

ok will try that, ty
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
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 11:57.


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