diff --git a/GangsAPI/Data/Command/CommandInfoWrapper.cs b/GangsAPI/Data/Command/CommandInfoWrapper.cs index 4964628..8be4c80 100644 --- a/GangsAPI/Data/Command/CommandInfoWrapper.cs +++ b/GangsAPI/Data/Command/CommandInfoWrapper.cs @@ -44,11 +44,9 @@ public void ReplySync(string message) { return; } - Server.NextFrame(() => { - if (CallingContext == CommandCallingContext.Console) - CallingPlayer.PrintToConsole(message); - else - CallingPlayer.PrintToChat(message); - }); + if (CallingContext == CommandCallingContext.Console) + CallingPlayer.PrintToConsole(message); + else + CallingPlayer.PrintToChat(message); } } \ No newline at end of file diff --git a/GangsAPI/Data/PlayerWrapper.cs b/GangsAPI/Data/PlayerWrapper.cs index 157a844..acf3e74 100644 --- a/GangsAPI/Data/PlayerWrapper.cs +++ b/GangsAPI/Data/PlayerWrapper.cs @@ -114,7 +114,9 @@ public void PrintToChat(string message) { return; } - Server.NextFrame(() => Player.PrintToChat(message)); + Server.NextFrame(() => { + if (Player.IsValid) Player.PrintToChat(message); + }); } public void PrintToConsole(string message) { @@ -124,6 +126,8 @@ public void PrintToConsole(string message) { return; } - Server.NextFrame(() => Player.PrintToConsole(message)); + Server.NextFrame(() => { + if (Player.IsValid) Player.PrintToConsole(message); + }); } } \ No newline at end of file