<Button Visible="False" Name="Kick" Text="{Loc 'admin-player-actions-kick'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Ban" Text="{Loc 'admin-player-actions-ban'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Respawn" Text="{Loc 'admin-player-actions-respawn'}" StyleClasses="OpenBoth" />
- <Button Visible="False" Name="Teleport" Text="{Loc 'admin-player-actions-teleport'}" StyleClasses="OpenLeft" />
+ <Button Visible="False" Name="Follow" Text="{Loc 'admin-player-actions-follow'}" StyleClasses="OpenLeft" />
</BoxContainer>
</BoxContainer>
</SplitContainer>
_console.ExecuteCommand($"kick \"{_currentPlayer.Username}\"");
};
- Teleport.OnPressed += _ =>
+ Follow.OnPressed += _ =>
{
if (_currentPlayer is not null)
- _console.ExecuteCommand($"tpto \"{_currentPlayer.Username}\"");
+ _console.ExecuteCommand($"follow \"{_currentPlayer.NetEntity}\"");
};
Respawn.OnPressed += _ =>
Respawn.Visible = _adminManager.CanCommand("respawn");
Respawn.Disabled = !Respawn.Visible || disabled;
- Teleport.Visible = _adminManager.CanCommand("tpto");
- Teleport.Disabled = !Teleport.Visible || disabled;
+ Follow.Visible = _adminManager.CanCommand("follow");
+ Follow.Disabled = !Follow.Visible || disabled;
}
private string FormatTabTitle(ItemList.Item li, PlayerInfo? pl = default)
--- /dev/null
+using Content.Shared.Administration;
+using Content.Shared.Follower;
+using Robust.Shared.Console;
+using Robust.Shared.Enums;
+
+namespace Content.Server.Administration.Commands;
+
+[AdminCommand(AdminFlags.Admin)]
+public sealed class FollowCommand : IConsoleCommand
+{
+ [Dependency] private readonly IEntityManager _entManager = default!;
+
+ public string Command => "follow";
+ public string Description => Loc.GetString("add-uplink-command-description");
+ public string Help => Loc.GetString("add-uplink-command-help");
+
+ public void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var player = shell.Player;
+ if (player == null)
+ {
+ shell.WriteError(Loc.GetString("shell-only-players-can-run-this-command"));
+ return;
+ }
+
+ if (args.Length != 1)
+ {
+ shell.WriteError(Loc.GetString("shell-need-exactly-one-argument"));
+ return;
+ }
+
+ if (player.Status != SessionStatus.InGame || player.AttachedEntity is not { Valid: true } playerEntity)
+ {
+ shell.WriteError(Loc.GetString("shell-must-be-attached-to-entity"));
+ return;
+ }
+
+ var entity = args[0];
+ if (NetEntity.TryParse(entity, out var uidNet) && _entManager.TryGetEntity(uidNet, out var uid))
+ {
+ _entManager.System<FollowerSystem>().StartFollowingEntity(playerEntity, uid.Value);
+ }
+ }
+}
--- /dev/null
+follow-command-description = Makes you begin following an entity
+follow-command-help = Usage: follow [netEntity]
\ No newline at end of file
admin-player-spawn-failed = Failed to find valid coordinates
admin-player-actions-clone = Clone
-admin-player-actions-teleport = Teleport To
+admin-player-actions-follow = Follow
admin-player-actions-confirm = Are you sure?