Code:
on *:JOIN:*: {
  ctcp $nick VERSION
  set %nick $nick
  set %chan $chan
}
on *:CTCPREPLY:VERSION*: {
  if (mIRC v6.16 Khaled Mardam-Bey isin $1-) {
    mode %chan +v %nick
  }
}


there might b a better way to do it, but that should do it