Here is the edit of my example to do what you want:
Code:
on *:text:!prizes*:#:{
  var %f $+(prizes,#,.ini)
  if !$2 {
    .msg # There has been $readini(%f,total,total) prize(s) sent from #
  }
  elseif $ini(%f,$2) {
    if (!$hget(prize)) hmake prize 200
    hload -i prize %f $2
    var %r 1
    while %r <= $hget(prize,%r).item {
      var %x $addtok(%x,$hget(prize,%r).data,44)
      inc %r
    }
    .msg # * There has been $numtok(%x,44) prize(s) sent from $2.
    hfree prize
  }
  else .msg # * The nickname $2 doesn't exist! 
}


This is merely my way of going about what you wish for. If you find Riamus2's favorable, by all means, use his. The only difference that sets mine apart from his is the use of hload with the -i switch and an additional check for whether a nick to be searched for exists.

Last edited by Tomao; 05/06/11 10:43 PM.