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

What msgid for csay's in CSS?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 10-26-2005 , 19:28   What msgid for csay's in CSS?
Reply With Quote #1

Code:
MRecipientFilter mrf(m_Engine,m_PlayerInfo,m_PluginHelpers);
	mrf.AddAllPlayers(sInfo.maxPlayers);
	//META_LOG(g_PLAPI,"Csay with %i",iCsayMsg);
	bf_write *msg = m_Engine->UserMessageBegin((IRecipientFilter *)&mrf,iCsayMsg);
	//msg->WriteByte(4); //4
	//msg->WriteString(temp);
	msg->WriteByte( 0); //textparms.channel
	msg->WriteFloat( -1 ); // textparms.x ( -1 = center )
	msg->WriteFloat( -.25 ); // textparms.y ( -1 = center )
	msg->WriteByte( 0xFF ); //textparms.r1
	msg->WriteByte( 0x00 ); //textparms.g1
	msg->WriteByte( 0x00 ); //textparms.b1
	msg->WriteByte( 0xFF ); //textparms.a2
	msg->WriteByte( 0xFF ); //textparms.r2
	msg->WriteByte( 0xFF ); //textparms.g2
	msg->WriteByte( 0xFF ); //textparms.b2
	msg->WriteByte( 0xFF ); //textparms.a2
	msg->WriteByte( 0x00); //textparms.effect
	msg->WriteFloat( 0 ); //textparms.fadeinTime
	msg->WriteFloat( 0 ); //textparms.fadeoutTime
	msg->WriteFloat( 30 ); //textparms.holdtime
	msg->WriteFloat( 45 ); //textparms.fxtime
	msg->WriteString( temp ); //Message
	m_Engine->MessageEnd();
}
What do I use for iCsayMsg to get csays to appear in CSS? A 4 works for HL2DM, and most mods.. but not css
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BAILOPAN
Join Date: Jan 2004
Old 10-26-2005 , 19:57  
Reply With Quote #2

#define MESSAGE_CLIENT 3
#define MESSAGE_MENU 10

I have those in CS:S DM. I don't know even know what #3 is anymore but hey

try enumerating them with IServerGameDLL::GetUserMessageInfo
__________________
egg
BAILOPAN is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 10-26-2005 , 20:10  
Reply With Quote #3

Quote:
Originally Posted by BAILOPAN
#define MESSAGE_CLIENT 3
#define MESSAGE_MENU 10

I have those in CS:S DM. I don't know even know what #3 is anymore but hey

try enumerating them with IServerGameDLL::GetUserMessageInfo
I tried that.. any number I used crashed the server.. It wasnt fun.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
BAILOPAN
Join Date: Jan 2004
Old 10-26-2005 , 21:06  
Reply With Quote #4

Oh, right. I use this for messaging players, but I've not done csay stuff:

Code:
void MessagePlayer(int index, const char *msg, ...)
{
	RecipientFilter rf;

	if (index > g_ClientMax || index < 0)
		return;

	if (index == 0)
	{
		rf.AddAllPlayers(g_ClientMax);
	} else {
		rf.AddPlayer(index);
	}

	char vafmt[1024];
	va_list ap;
	va_start(ap, msg);
	_vsnprintf(vafmt, sizeof(vafmt)-1, msg, ap);
	va_end(ap);

	bf_write *buffer = g_Plugin.GetEngine()->UserMessageBegin(static_cast<IRecipientFilter *>(&rf), MESSAGE_CLIENT);
	buffer->WriteByte(0);
	buffer->WriteString(vafmt);
	buffer->WriteByte(1);
	g_Plugin.GetEngine()->MessageEnd();
}
__________________
egg
BAILOPAN is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 10-26-2005 , 21:09  
Reply With Quote #5

Csays are broken in CSS.

Not fun, oh well.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-26-2005 , 21:51  
Reply With Quote #6

No their not, its as follows (No Color).

Code:
	MRecipientFilter recipient_filter;
	int iTextMsg = UserMessageIndex("TextMsg"); //Sometimes it doesnt get it on load.
	recipient_filter.AddAllPlayers( m_PlayerInfoManager, maxClients );
   bf_write *pWrite = m_Engine->UserMessageBegin( &recipient_filter, iTextMsg ); // 4 for HL2 
   pWrite->WriteByte( 4 ); // Centered TextMsg 
   pWrite->WriteString( pMessage ); // Message 
   m_Engine->MessageEnd();
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-26-2005 , 21:51  
Reply With Quote #7

Code:
int UserMessageIndex(const char *messageName)
{ 
	//Returns MessageIndex IDs from Msg String
	char name[128] = "";
	int sizereturn = 0;
	bool boolrtn = false; 

	for(int x=1; x<22; x++) 
	{ 
		boolrtn =  m_ServerDll->GetUserMessageInfo(x, name, 128, sizereturn);
		if(name && strcmp(messageName, name) == 0) 
		{
			return x;     
		}
	} 
	return -1; 
}
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 10-27-2005 , 10:02  
Reply With Quote #8

Alfred removed the hudmessages from CS:S.. Like where you select a channel, he won't let us use them, EVEN THOUGH it's in the client dll...

Everyone bitches on hlcoders and he just laughs about it
__________________
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



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 21:52.


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