on @*:text:x *:#:{
if ($2 == op) /mode $chan +o $nick
elseif ($2 == owner) && ($me isowner $chan) mode $chan +q $nick
elseif ($2 == voice) mode $chan +v $nick
}

Id suggest using a symbol to mark the command. Like !x or .x.

on @*:text:!x *:#:{