12-15-2012, 11:51
Where an error?
The message comes together without blanks
The message comes together without blanks
Quote:[PM]: hihowareyou
Code:
//pm's a player with supplied message
void personalMessage(ServerClient issuer, String message)
{
String[] split = message.Split(' ');
ServerClient target;
if (!(split.Length > 1))
{
TellClient(issuer.ClientNum, "Please provide a receiver", true);
return;
}
else if (!(split.Length > 2))
{
TellClient(issuer.ClientNum, "Please provide a message", true);
return;
}
target = findClient(split[1]);
if (target == null)
{
TellClient(issuer.ClientNum, "Player could not be found, or multiple were found", true);
return;
}
else
{
String pmessage = "";
for (int i = 2; i < split.Length; i++)
{
pmessage += split[i];
}
TellClient(target.ClientNum, "^1[PM]^2" + issuer.Name + ":^7 " + pmessage, true);
}
}