When someone in the room uses the command op / halfop / voice / devoice, it will msg to another room. But this code below is not work. Someone can fixed it for me. Thanks all

on *:mode:#: {
if ($rcheck($network,%serv1,$chan1,%chan1)) { relay %serv2 msg %chan2 3 $+ ( $+ $network $+ ) $nick sets mode: $1- }
elseif ($rcheck($network,%serv2,$chan2,%chan2)) { relay %serv1 msg %chan1 3 $+ ( $+ $network $+ ) $nick sets mode: $1- }
}