protected override void SetPlayerData(Player p, Player who, string nick) { if (nick.Length == 0) { Chat.MessageFrom(who, "λNICK %Shad their custom nick reset"); who.DisplayName = who.truename; } else { if (nick.Length >= 30) { p.Message("Nick must be under 30 letters."); return; } Chat.MessageFrom(who, "λNICK %Shad their nick set to " + who.color + nick); who.DisplayName = nick; } PlayerDB.Save(who); }
protected override void SetPlayerData(Player p, Player who, string nick) { if (nick.Length == 0) { Chat.MessageGlobal(who, who.FullName + " %Sreverted their nick to their original name.", false); who.DisplayName = who.truename; } else { if (nick.Length >= 30) { Player.Message(p, "Nick must be under 30 letters."); return; } Chat.MessageGlobal(who, who.FullName + " %Shad their nick changed to " + who.color + nick + "%S.", false); who.DisplayName = nick; } PlayerDB.Save(who); }
protected override void SetPlayerData(Player p, Player who, string[] args) { string newName = args.Length > 1 ? args[1] : ""; if (newName == "") { who.DisplayName = who.truename; Player.SendChatFrom(who, who.FullName + " %Sreverted their nick to their original name.", false); } else { if (newName.Length >= 30) { Player.Message(p, "Nick must be under 30 letters."); return; } Player.SendChatFrom(who, who.FullName + " %Schanged their nick to " + who.color + newName + "%S.", false); who.DisplayName = newName; } PlayerDB.Save(who); }
public override void Use(Player p, string message) { if (message == "") { Help(p); return; } string[] parts = message.Split(trimChars, 2); Player who = PlayerInfo.FindOrShowMatches(p, parts[0]); if (who == null) { return; } if (p != null && who.group.Permission > p.group.Permission) { MessageTooHighRank(p, "change the nick of", true); return; } string newName = parts.Length > 1 ? parts[1] : ""; if (newName == "") { who.DisplayName = who.truename; Player.SendChatFrom(who, who.FullName + "%S has reverted their nick to their original name.", false); } else { if (newName.Length >= 30) { Player.SendMessage(p, "Nick must be under 30 letters."); return; } Player.SendChatFrom(who, who.FullName + "%S has changed their nick to " + who.color + newName + "%S.", false); who.DisplayName = newName; } Entities.GlobalDespawn(who, false); Entities.GlobalSpawn(who, false); PlayerDB.Save(who); }