mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Make various output messages in /award better.
This commit is contained in:
parent
62ed6f3642
commit
ea67c61d79
@ -24,7 +24,6 @@ namespace MCGalaxy.Commands.Eco {
|
|||||||
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (message.Length == 0 || message.IndexOf(' ') == -1) { Help(p); return; }
|
|
||||||
bool take = false;
|
bool take = false;
|
||||||
if (message.CaselessStarts("give ")) {
|
if (message.CaselessStarts("give ")) {
|
||||||
message = message.Substring(5);
|
message = message.Substring(5);
|
||||||
@ -33,28 +32,30 @@ namespace MCGalaxy.Commands.Eco {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string[] args = message.SplitSpaces(2);
|
string[] args = message.SplitSpaces(2);
|
||||||
|
if (args.Length < 2) { Help(p); return; }
|
||||||
string plName = PlayerInfo.FindMatchesPreferOnline(p, args[0]);
|
string plName = PlayerInfo.FindMatchesPreferOnline(p, args[0]);
|
||||||
if (plName == null) return;
|
if (plName == null) return;
|
||||||
|
string award = Matcher.FindAwards(p, args[1]);
|
||||||
string award = args.Length > 1 ? args[1] : "";
|
|
||||||
award = Matcher.FindAwards(p, award);
|
|
||||||
if (award == null) { Player.Message(p, "Use %T/Awards %Sfor a list of awards"); return; }
|
if (award == null) { Player.Message(p, "Use %T/Awards %Sfor a list of awards"); return; }
|
||||||
|
|
||||||
|
string displayName = PlayerInfo.GetColoredName(p, plName);
|
||||||
if (!take) {
|
if (!take) {
|
||||||
if (Awards.GiveAward(plName, award)) {
|
if (Awards.GiveAward(plName, award)) {
|
||||||
Chat.MessageGlobal("{0} %Swas awarded: &b{1}",
|
Chat.MessageGlobal("{0} %Swas awarded: &b{1}", displayName, award);
|
||||||
PlayerInfo.GetColoredName(p, plName), award);
|
|
||||||
Awards.SavePlayers();
|
Awards.SavePlayers();
|
||||||
|
} else if (p != null && plName.CaselessEq(p.name)) {
|
||||||
|
Player.Message(p, "You already have that award.");
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "The player already has that award."); return;
|
Player.Message(p, "{0} %Salready has that award.", displayName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (Awards.TakeAward(plName, award)) {
|
if (Awards.TakeAward(plName, award)) {
|
||||||
Chat.MessageGlobal("{0} %Shad their &b{1} %Saward removed",
|
Chat.MessageGlobal("{0} %Shad their &b{1} %Saward removed", displayName, award);
|
||||||
PlayerInfo.GetColoredName(p, plName), award);
|
|
||||||
Awards.SavePlayers();
|
Awards.SavePlayers();
|
||||||
|
} else if (p != null && plName.CaselessEq(p.name)) {
|
||||||
|
Player.Message(p, "You did not have that award to begin with.");
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "The player didn't have the award you tried to take"); return;
|
Player.Message(p, "{0} %Sdid not have that award to begin with.", displayName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ namespace MCGalaxy.Core {
|
|||||||
case ModActionType.Muted:
|
case ModActionType.Muted:
|
||||||
AddNote(action, "M"); break;
|
AddNote(action, "M"); break;
|
||||||
case ModActionType.Warned:
|
case ModActionType.Warned:
|
||||||
AddNote(action, "W"); break;
|
AddNote(action, "W"); break;
|
||||||
case ModActionType.Ban:
|
case ModActionType.Ban:
|
||||||
string banType = action.Duration.Ticks != 0 ? "T" : "B";
|
string banType = action.Duration.Ticks != 0 ? "T" : "B";
|
||||||
AddNote(action, banType); break;
|
AddNote(action, banType); break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user