JASS:
loop
call TriggerRegisterPlayerChatEvent(t,Player(i),MODE_CHARACTER,false)
exitwhen 0==i
set i=i-1
endloop
Add a check to see if the player is playing and a check for if the player is human similar to what purge does a lot like in his scripts like Track.