-edit-
ah, and $1 is the nickname, $2 is the channel you're trying to send to.
Tip: As it seems you're using mIRC, type /debug @window. Everything that you send to or receive from the server will be in @window, easy to find out numerics and how the error messages are build.