Fix Spec
This commit is contained in:
@@ -1797,6 +1797,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
}
|
||||
Player target;
|
||||
|
||||
bool currentStatus = user.GetData<bool>("adminUnshow");
|
||||
|
||||
if (targetname != null)
|
||||
{
|
||||
@@ -1813,11 +1814,24 @@ namespace ReallifeGamemode.Server.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!currentStatus)
|
||||
{
|
||||
currentStatus = !currentStatus;
|
||||
user.SetData("adminUnshow", currentStatus);
|
||||
}
|
||||
player.TriggerEvent("toggleAdminUnshowMode", currentStatus);
|
||||
player.SetData<Vector3>("specPosition", player.Position);
|
||||
|
||||
player.SafeTeleport(target.Position);
|
||||
|
||||
player.TriggerEvent("SERVER:ADMIN_SPECTATE", target);
|
||||
}
|
||||
else
|
||||
{
|
||||
currentStatus = !currentStatus;
|
||||
user.SetData("adminUnshow", currentStatus);
|
||||
player.TriggerEvent("SERVER:ADMIN_STOP_SPECTATE");
|
||||
player.SafeTeleport(player.GetData<Vector3>("specPosition"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user