Skip to content

Commit

Permalink
Add helper command for Player toolshed commands (#4987)
Browse files Browse the repository at this point in the history
Allows you to invoke players:entity with a username to immediate get that player's attached entity(if any)
  • Loading branch information
nikthechampiongr committed Mar 23, 2024
1 parent 1f2b38a commit 0a79382
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Robust.Server/Toolshed/Commands/Players/PlayersCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public EntityUid GetPlayerEntity([PipedArgument] ICommonSession sessions)
{
return sessions.AttachedEntity ?? default;
}

[CommandImplementation("entity")]
public EntityUid GetPlayerEntity([CommandInvocationContext] IInvocationContext ctx, [CommandArgument] string username)
{
return GetPlayerEntity(Immediate(ctx, username));
}
}

public record struct NoSuchPlayerError(string Username) : IConError
Expand Down

0 comments on commit 0a79382

Please sign in to comment.