I've got the .IndexOf etc messed up, and I want to know how to get it right, cuz its a bit confusing.
- Code: Select all
if (message.Split(' ').Length > 2) // if someone is going to provide a reason.
{
m = message.Substring(message.IndexOf(' ') + 2); // there is where im having trouble.
if (p == null)
{
File.AppendAllText(path, Environment.NewLine + who.name + " - temp-banned by: Console/IRC, for: " + minutes + " minute(s), reason: " + m + ", date: " + DateTime.Now + ".");
}
File.AppendAllText(path, Environment.NewLine + who.name + " - temp-banned by: " + p.PublicName + ", for: " + minutes + " minute(s), reason: " + m + ", date: " + DateTime.Now + ".");
}
else // if no reason
{
Format is as is, /tempban [player] [time] [reason]
When I type /tempban player time, it says invalid minutes
same with if I put a reason, I'm typing a number between 1 and 60
/e string m represents the kick message
Halp?:3