Added the final missing terraria command.
Removed Terraria commands from the output of help.
This commit is contained in:
parent
b8e4df2912
commit
e30ddc0079
1 changed files with 31 additions and 21 deletions
|
|
@ -106,6 +106,7 @@ namespace TShockAPI
|
|||
commands.Add(new Command("playing", "", Playing));
|
||||
commands.Add(new Command("auth", "", AuthToken));
|
||||
commands.Add(new Command("me", "", ThirdPerson));
|
||||
commands.Add(new Command("p", "", PartyChat));
|
||||
if (ConfigurationManager.distributationAgent != "terraria-online")
|
||||
{
|
||||
commands.Add(new Command("kill", "kill", Kill));
|
||||
|
|
@ -117,6 +118,26 @@ namespace TShockAPI
|
|||
|
||||
#region Command Methods
|
||||
|
||||
public static void PartyChat(CommandArgs args)
|
||||
{
|
||||
int playerTeam = Main.player[args.PlayerID].team;
|
||||
if (playerTeam != 0)
|
||||
{
|
||||
string msg = "<" + Main.player[args.PlayerID].name + "> " + args.Message.Remove(0, 3);
|
||||
for (int i = 0; i < Main.player.Length; i++)
|
||||
{
|
||||
if (Main.player[i].team == Main.player[args.PlayerID].team)
|
||||
{
|
||||
Tools.SendMessage(i, msg, new float[] { (float)Main.teamColor[playerTeam].R, (float)Main.teamColor[playerTeam].G, (float)Main.teamColor[playerTeam].B });
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Tools.SendMessage(args.PlayerID, "You are not in a party!", new float[]{ 255f, 240f, 20f});
|
||||
}
|
||||
}
|
||||
|
||||
public static void ThirdPerson(CommandArgs args)
|
||||
{
|
||||
string msg = args.Message.Remove(0, 3);
|
||||
|
|
@ -574,8 +595,6 @@ namespace TShockAPI
|
|||
{
|
||||
int ply = args.PlayerID;
|
||||
Tools.SendMessage(ply, "TShock Commands:");
|
||||
int h = 1;
|
||||
int i = 0;
|
||||
string tempstring = "";
|
||||
int page = 1;
|
||||
if (args.Message.Split(' ').Length == 2)
|
||||
|
|
@ -590,25 +609,18 @@ namespace TShockAPI
|
|||
}
|
||||
if (cmdlist.Count > (15 * (page - 1)))
|
||||
{
|
||||
for (int j = (15*(page - 1)); j < cmdlist.Count; j++)
|
||||
for (int j = (15 * (page - 1)); j < (15 * page); j++)
|
||||
{
|
||||
if (i == 3) break;
|
||||
tempstring += "/" + cmdlist[j].Name() + ", ";
|
||||
if (j == cmdlist.Count - 1)
|
||||
{
|
||||
tempstring += "/" + cmdlist[j].Name() + ", ";
|
||||
Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), new[] { 255f, 255f, 0f });
|
||||
break;
|
||||
}
|
||||
if ((h - 1)%5 == 0 && (h - 1) != 0)
|
||||
if ((j + 1) % 5 == 0)
|
||||
{
|
||||
Tools.SendMessage(ply, tempstring.TrimEnd(new[] { ' ', ',' }), new[] { 255f, 255f, 0f });
|
||||
tempstring = "/" + cmdlist[j].Name() + ", ";
|
||||
i++;
|
||||
h++;
|
||||
}
|
||||
else
|
||||
{
|
||||
tempstring += "/" + cmdlist[j].Name() + ", ";
|
||||
h++;
|
||||
tempstring = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -616,8 +628,6 @@ namespace TShockAPI
|
|||
{
|
||||
Tools.SendMessage(ply, "Type /help " + (page + 1) + " for more commands.", new[] { 255f, 0f, 255f });
|
||||
}
|
||||
Tools.SendMessage(ply, "Terraria commands:");
|
||||
Tools.SendMessage(ply, "/playing, /p, /me", new[] {255f, 255f, 0f});
|
||||
}
|
||||
|
||||
public static void Time(CommandArgs args)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue