From f137095304f456b06229e4d17ee8249e974fceaf Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Fri, 28 Jul 2023 13:37:17 +0100 Subject: Add spectator mode --- code/Game.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'code/Game.cs') diff --git a/code/Game.cs b/code/Game.cs index f235df0..24fd79d 100644 --- a/code/Game.cs +++ b/code/Game.cs @@ -1,5 +1,6 @@  using Sandbox; +using Sandbox.UI; using System; using System.Collections.Generic; using System.Linq; @@ -64,6 +65,15 @@ public partial class MurderGame : Sandbox.GameManager tx.Position = tx.Position + Vector3.Up * 50.0f; pawn.Transform = tx; } + + ChatBox.Say( client.Name + " joined the game" ); + } + + public override void ClientDisconnect( IClient client, NetworkDisconnectionReason reason ) + { + base.ClientDisconnect(client, reason ); + + ChatBox.Say( client.Name + " left the game (" + reason.ToString() + ")" ); } } -- cgit v1.2.3-70-g09d2