Open AgaSpace opened 1 year ago
If there are already two /who
commands, using this hook will result in two Staff Online: a, b, c
or There are 5 players in dimensions
; it's understandable for this hook but not quite expected for the actual use case 🤔
If there are already two
/who
commands, using this hook will result in twoStaff Online: a, b, c
orThere are 5 players in dimensions
; it's understandable for this hook but not quite expected for the actual use case 🤔
You can get the command you need using Commands.ChatCommands.Find
, but I was too lazy to describe it :p
Although yes, you're right. It was inappropriate to include this example in the description of my changes.
If there are already two
/who
commands, using this hook will result in twoStaff Online: a, b, c
orThere are 5 players in dimensions
; it's understandable for this hook but not quite expected for the actual use case 🤔
Then how about marking the old hook (PlayerCommand) as obsolete?
@sgkoishi Is everything correct now?
There is a hook
PlayerHooks.PlayerCommand
which is called before using a command. In my personal opinion, this hook is obsolete because it could be used before calling a command (cmd.Run
inHandleCommand
). This would make it easier to work with commands because you wouldn't have to look for a command that might not exist inCommands.ChatCommands
. That's why I added thePlayerHooks.PrePlayerCommand
hook. Also, thePlayerCommand
hook does not implement the ability to handle commands after they are used, so I added thePostPlayerCommand
hook.If you would like to add "invisible" commands, which can be done with PlayerCommand, we already have a similar alternative (TSPlayer.AwaitingResponse).
Now some examples of how to use hooks: