From 93a2ec9402f0f370ef766d4e64f1154711b17f7c Mon Sep 17 00:00:00 2001 From: VegaZ Date: Wed, 5 May 2021 00:21:07 +0200 Subject: [PATCH] Fix Spec4 --- ReallifeGamemode.Server/Commands/AdminCommands.cs | 10 +++++++--- ReallifeGamemode.Server/Extensions/ClientExtension.cs | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index 8d60b90a..85fb8670 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1824,7 +1824,11 @@ namespace ReallifeGamemode.Server.Commands player.SafeTeleport(target.Position); - player.TriggerEvent("SERVER:ADMIN_SPECTATE", target); + NAPI.Task.Run(() => + { + player.TriggerEvent("SERVER:ADMIN_SPECTATE", target); + }, 100); + } else { @@ -1851,9 +1855,9 @@ namespace ReallifeGamemode.Server.Commands return; } - bool currentStatus = user.GetData("adminUnshow"); + bool currentStatus = player.GetData("adminUnshow"); currentStatus = !currentStatus; - user.SetData("adminUnshow", currentStatus); + player.SetData("adminUnshow", currentStatus); player.TriggerEvent("toggleAdminUnshowMode", currentStatus); user.SetBlipAndNametagColor(); diff --git a/ReallifeGamemode.Server/Extensions/ClientExtension.cs b/ReallifeGamemode.Server/Extensions/ClientExtension.cs index e2e1636b..5463e0f6 100644 --- a/ReallifeGamemode.Server/Extensions/ClientExtension.cs +++ b/ReallifeGamemode.Server/Extensions/ClientExtension.cs @@ -356,7 +356,7 @@ namespace ReallifeGamemode.Server.Extensions } bool duty = user.GetData("duty"); - bool adminUnshow = user.GetData("adminUnshow"); + bool adminUnshow = player.GetData("adminUnshow"); if (adminUnshow) {