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

Outputting message as a chat message?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JeT
Junior Member
Join Date: Jan 2005
Old 01-01-2005 , 19:23   Outputting message as a chat message?
Reply With Quote #1

When someone types /ff I want to be able to output the friendly fire status, I can output it through just a console message or one of those top left messages, but how can I just output it as a chat message?

I see one possible way of just having that said client automatically say it through executing a client console command. Basically making the client execute the command "say Friendly Fire: ON(OFF)"

But how can I just output it without it being from an actual person? I think I've seen a few servers do that, and I've seen many servers do that when I say /rank.

I'm sure someone can enlighten me.

Thank-you.
__________________
JeT
JeT is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 01-02-2005 , 04:12  
Reply With Quote #2

Uh - use the "Saytext" message with WriteByte(NULL), WriteString("Friendly fire is OFF, noof"), WriteBool(true)
__________________
Avoid like the plague.
vancelorgin is offline
Fruchtzwerg
Member
Join Date: Dec 2004
Old 01-02-2005 , 20:26  
Reply With Quote #3

engine->ServerCommand("say ff is on\n");
__________________
Fruchtzwerg is offline
JeT
Junior Member
Join Date: Jan 2005
Old 01-02-2005 , 20:57  
Reply With Quote #4

Quote:
Originally Posted by Fruchtzwerg
engine->ServerCommand("say ff is on\n");
Ah, thank-you.

That worked well enough.

I'm not sure exactly what poster #2 meant fully.

Still learning my way around this thing.
__________________
JeT
JeT is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 01-02-2005 , 22:11  
Reply With Quote #5

Code:
			bf_write *msg;
			MRecipientFilter f;
			f.AddPlayer(kIndex);
			msg = eng->UserMessageBegin((IRecipientFilter *)&f,3);
			msg->WriteByte(pIndex); //Player index it comes from
			msg->WriteString(temp); //Message
			msg->WriteByte(true); //Just leave this
			eng->MessageEnd();
MRecipientFilter.. There's some includes somewhere with a rewritten one, its up to you to find and use them.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
vancelorgin
Senior Member
Join Date: Dec 2004
Location: san frandisco
Old 01-02-2005 , 23:05  
Reply With Quote #6

It's worth it to write your own. The usefulness of not using servercommand say is that you can send text from other clients and to specific clients, and hence you have a say hook, and hence you have client saytext tokens and clean say commands
__________________
Avoid like the plague.
vancelorgin is offline
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 10:54.


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