Try using this code:

Syntax: !addcom <command> [-ul=mod] <text>
Example: !addcom !test -ul=mod This is an test command.
Example 2: !addcom !test2 This is an test2 command.

Code:
on *:text:!addcom *:#: {
  if ($nick isop #) {
    write commands.txt $2-
    msg $chan /me + Command $2 has been created!
  }
}
on *:text:!delcom *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -dl $+ $readn commands.txt
      msg $chan /me - Command $2- has been removed!
    }
  }
}
on *:text:!editcom & *:#: {
  if ($nick isop #) {
    if ($read(commands.txt, ns, $2)) {
      write -l $+ $readn commands.txt $2-
      msg $chan /me -> Command $2 has been edited!
    }
  }
}
on *:text:*:#: {
  tokenize 32 $strip($1-,burci)
  if ($read(commands.txt, ns, $1)) {
    var %com = $v1
    if (-ul=mod == $gettok(%com,1,32)) && ($nick !isop $chan) { msg $chan [ $+ $nick $+ ]: Error, You are NOT an channel operator! | return }
    msg $chan $gettok(%com,2-,32)
  }
}

Last edited by westor; 14/10/14 04:50 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-