I suggest you take a look at the mIRC help file. Look up "On Join" "On Quit" and "On Part".

Quit doesn't use a channel in the event. It is:

on *:quit:{ commands }

The code you have looks like it will work well for an on join command or on part as long as you get rid of the second asterik. Thats only used in a text event.

On *:join:#:{ commands }
on *:part:#:{ commands }