RusseB is correct, use $2 instead of $nick.
Raw 311:*: echo 2 -a $2- | halt
Praetorian Madison Staff.OranosChat.com * on ss
$2 returns the nickname
$3 returns the ident/user
$4 returns the address
$6- returns the fullname
A more detailed explanation on Raw events can be found
here