String val = _usrCommand.substring(4);
StringTokenizer st = new StringTokenizer(val);
String name = st.nextToken();
String message = val.substring(name.length()+1);
L2PcInstance reciever = L2World.getInstance().getPlayer(name);
CreatureSay cs = new CreatureSay(0, Say2.TELL, "Telnet Priv", message);
if(reciever != null)
{
reciever.sendPacket(cs);
_print.println("Telnet Priv->" + name + ": " + message);
_print.println("Message Sent!");
}
else
{
_print.println("Unable To Find Username: " + name);
}
}
catch (StringIndexOutOfBoundsException e)
{
_print.println("Please Enter Some Text!");
}
}
else if (_usrCommand.startsWith("gmchat"))
{
try
{
_usrCommand = _usrCommand.substring(7);
CreatureSay cs = new CreatureSay(0, 9, "Telnet GM Broadcast from " + _cSocket.getInetAddress().getHostAddress(), _usrCommand);
GmListTable.broadcastToGMs(cs);
_print.println("Your Message Has Been Sent To " + getOnlineGMS() + " GM(s).");
}
catch (StringIndexOutOfBoundsException e)
{