Game Development Community

How to Send a Message to a Specific Player

by Richard Bottoms · in Torque Game Engine · 03/17/2005 (3:26 am) · 4 replies

Been looking for an example of sending a message to a specific user.

For example Citizen, Citizen.1, Citizen.2 are in the game. I am Citizen and I want to send a message only to Citizen.2. How is that done please.



thx

#1
03/17/2005 (4:03 am)
Not sure if it helps but you might want to take a look at common/client/message.cs
#2
03/17/2005 (4:14 am)
Looking at it right now, plus I have 3D All in One. I am trying to send a message from the console as a test but ClientGroup.getCount(); doesn't seem to work.

I tried echo ( ClientGroup.getCount() ); but it comes back 0 even when clients are connected.
#3
03/17/2005 (4:20 am)
What would really be useful is being able to see a player's name and to send them a message without knowing any other ID info. Of course the back end would be where all that is figured out.
#4
03/17/2005 (5:11 am)
Add a function -- when they type /tell "poopman", use getword, if getWord(%input,0) $= "/tell", send a commandToServer to the server with "poopman" (getword(2)), then loop thru the clientlist, checking names, then sending a commandToClient to the client who will receive the message, and put the message in his chat box.

ClientGroup is accessable on servers only, I believe.