hinc -m $+(tickets.,#) $nick add hashtable with numbers as item and $nick as data, while you $hget($+(tickets.,#),$nick) using $nick as item which is never exists.

Also, this line var %i = $r(1,$hget(,0).item is incorrect.