From 5c5f852acd12dd985b9a14c57f6fdcbaf3d42af3 Mon Sep 17 00:00:00 2001
From: rtxa <usertxa@gmail.com>
Date: Wed, 7 Aug 2024 21:23:54 -0300
Subject: [PATCH] Fixed players not part of the match not being displayed as
 spectators when server is paused

---
 valve/addons/amxmodx/scripting/agmodx.sma | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/valve/addons/amxmodx/scripting/agmodx.sma b/valve/addons/amxmodx/scripting/agmodx.sma
index 33596d0..8f34bb5 100644
--- a/valve/addons/amxmodx/scripting/agmodx.sma
+++ b/valve/addons/amxmodx/scripting/agmodx.sma
@@ -447,6 +447,8 @@ public plugin_init() {
 
 	register_concmd("help", "CmdHelp", ADMIN_ALL, "AGCMD_HELP", _, true);
 
+	register_concmd("test", "CmdTest", ADMIN_ALL);
+
 	register_clcmd("spectate", "CmdSpectate"); // block spectate
 	register_clcmd("drop", "CmdDrop"); // block drop
 	register_clcmd("jointeam", "CmdJoinTeam"); // this will make work the vgui
@@ -559,8 +561,11 @@ public client_putinserver(id) {
 	if (gSendConnectingToSpec) {
 		// warning: authid checking can fail because client_authorized() can be called after this...
 		if (!gVersusStarted || !RestoreScore_FindPlayer(id)) {
+			set_pev(id, pev_iuser1, 1); // This will make it show up in the scoreboard in spectator list
 			set_task(0.1, "SendToSpec", id + TASK_SENDTOSPEC); // delay to avoid some scoreboard glitchs
 		}
+
+		
 	}
 
 	set_task(3.0, "ShowSettings", id);