Add Spectate command, Connectmsg only if isLoggedIn 1
This commit is contained in:
@@ -811,6 +811,42 @@ namespace reallife_gamemode.Server.Commands
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Command("spec", "~m~Benutzung: ~s~/spec [Player]")]
|
||||
public void CmdAdminSpectate(Client player, string name)
|
||||
{
|
||||
if (!player.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(player);
|
||||
return;
|
||||
}
|
||||
Client target = ClientService.GetClientByName(name);
|
||||
if (target == null)
|
||||
{
|
||||
ChatService.PlayerNotFound(player);
|
||||
return;
|
||||
}
|
||||
if (target == player)
|
||||
{
|
||||
ChatService.ErrorMsg(player);
|
||||
return;
|
||||
}
|
||||
|
||||
bool spec = player.GetData("spec");
|
||||
|
||||
if (spec == false)
|
||||
{
|
||||
NAPI.Player.SetPlayerToSpectatePlayer(player, target);
|
||||
player.SetData("spec", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
NAPI.Player.UnspectatePlayer(player);
|
||||
player.SetData("spec", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[Command("ip", "~m~Benutzung: ~s~/ip [Spieler]")]
|
||||
public void CmdAdminIp(Client player, string targetname)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user