Tried a bunch of stuff in the plugin I've included.
- The plugin prints "in spectate listener" if I am already in spectator and type spectate in console.
- The plugin prints both "in spectate listener" and "in delayed team menu response" if I am not in spectator and I type spectate in console.
- The plugin prints "in jointeam listener" and "in delayed team menu response" if I use jointeam command, nomatter what team I am on.
- The plugin prints "in delayed team menu response" when I use either sm_spectate or sm_join
- The plugin prints nothing when I use the teammenu hotkey (M) or when I type teammenu in console.
I can't figure out a way to do it.