lol
But won't this function waste CPU usage?
It calls every time when a player types a character :/
Exactly, it would waste a lot of server/client resources which is in my opinion a pretty bad idea. It's kinda easy to make a suggestion, but you should always consider CPU & bandwidth usage.