Skip to content

Commit

Permalink
Added CloseCommand example
Browse files Browse the repository at this point in the history
  • Loading branch information
dassjosh committed Oct 30, 2024
1 parent 1661b7e commit af4e46c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,15 @@ private void CreateUi(BasePlayer player

builder.AddUi(player); //By default the builder will auto destroy the previous UI if it exists on the client
}


[ConsoleCommand(nameof(CloseCommand))]
private void CloseCommand(ConsoleSystem.Arg arg)
{
BasePlayer player = arg.Player();
if (player)
{
UiBuilder.DestroyUi(player, MainUi);
}
}
```

0 comments on commit af4e46c

Please sign in to comment.