mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-25 14:17:29 -04:00
Impersonate bug fixes
See post on #123 Can no longer impersonate muted players Trying to impersonate a player on server without giving a message threw an error, fixed.
This commit is contained in:
parent
e7f148c97b
commit
07fe07aca2
@ -27,10 +27,11 @@ namespace MCGalaxy.Commands {
|
|||||||
static char[] trimChars = { ' ' };
|
static char[] trimChars = { ' ' };
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string message) {
|
||||||
if (message == "") { Help(p); return; }
|
if (!message.Contains(" ")) { Help(p); return; }
|
||||||
string[] args = message.Split(trimChars, 2);
|
string[] args = message.Split(trimChars, 2);
|
||||||
Player who = PlayerInfo.FindOrShowMatches(p, args[0]);
|
Player who = PlayerInfo.FindOrShowMatches(p, args[0]);
|
||||||
if (who == null) return;
|
if (who == null || message == "") {Help(p); return; }
|
||||||
|
if (who.muted) { Player.SendMessage(p, "Cannot impersonate a muted player"); return; }
|
||||||
|
|
||||||
if (p == null || p == who || p.group.Permission > who.group.Permission) {
|
if (p == null || p == who || p.group.Permission > who.group.Permission) {
|
||||||
Player.SendChatFrom(who, args[1]);
|
Player.SendChatFrom(who, args[1]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user