Ctcp *:dcc send *:?:{
var %ip = $longip($gettok($1-,-3,32))
echo -s IP of $nick is: %ip
if %ip == 127.0.0.1 { halt }
}

If you want to see the format of the CTCP message, open a debug window by typing: /debug @debug. It is also recommended that you read /help dcc resume protocol