Fix Spec
This commit is contained in:
@@ -1797,6 +1797,7 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
}
|
}
|
||||||
Player target;
|
Player target;
|
||||||
|
|
||||||
|
bool currentStatus = user.GetData<bool>("adminUnshow");
|
||||||
|
|
||||||
if (targetname != null)
|
if (targetname != null)
|
||||||
{
|
{
|
||||||
@@ -1812,12 +1813,25 @@ namespace ReallifeGamemode.Server.Commands
|
|||||||
ChatService.ErrorMessage(player, "Du kannst dich nicht selbst spectaten");
|
ChatService.ErrorMessage(player, "Du kannst dich nicht selbst spectaten");
|
||||||
return;
|
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);
|
player.TriggerEvent("SERVER:ADMIN_SPECTATE", target);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
currentStatus = !currentStatus;
|
||||||
|
user.SetData("adminUnshow", currentStatus);
|
||||||
player.TriggerEvent("SERVER:ADMIN_STOP_SPECTATE");
|
player.TriggerEvent("SERVER:ADMIN_STOP_SPECTATE");
|
||||||
|
player.SafeTeleport(player.GetData<Vector3>("specPosition"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user