Originally Posted By: westor
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)
  }
}


Wait, One thing i wanna ask can you like use !editcom to make it so you can make a non mod only command, A mod only command
Like for example,
!addcom !test Hello
Then i was like Oh, I forgot the mod only part.
So then i could do
!editcom !test -ul=mod Hello