~/paste/19090
~/paste/19090
~/paste/19090

  1. #chHelperz main.ms ver 1.0
  2. export('chHelperz.version', '1.0')
  3. export('chHelperz.console.command.show', get_value('chHelperz.console.command.show'))
  4.  
  5.  
  6.  
  7. bind(player_command, array(id: 'chHelperz.cmd'), null, @cmdevent,
  8.         assign(@player, player())
  9.         assign(@cmd, reg_split(' ', @cmdevent[command]))
  10.         assign(@dev, false)
  11.  
  12.         #List cmd used, with CH aliases showing as a different color.
  13.         if(is_alias(@cmd[0]), assign(@cmdcolor, 3), assign(@cmdcolor, 6))
  14.  
  15.         #show command to the console if permitted to do so.
  16.         assign(@consolecmdshow, import('chHelperz.console.command.show'))
  17.  
  18.         #show command back to the player who issued the command, if permitted to do so.
  19.         assign(@sendcmd, import('chHelperz.player.'.@player.'.command.show.all'))
  20.         if(@sendcmd == null,
  21.                         assign(@sendcmd, get_value('chHelperz.player.'.@player.'.command.show.all'))
  22.                         export('chHelperz.player.'.@player.'.command.show.all', @sendcmd)
  23.         )
  24.  
  25.         #Show this command to the player & console.
  26.         switch(@cmd[0]){
  27.         case '/.':
  28.         case '/repeat':
  29.         case '/\'':
  30.                 if(@dev == true, msg('[dev] /repeat'))
  31.                 if(@consolecmdshow == true,
  32.                         assign(@lastcmd, import('chHelperz.player.'.@player.'.last.command'))
  33.                         #List cmd used, with CH aliases showing as a different color.
  34.                         if(is_alias(@lastcmd), assign(@cmdcolor, 3), assign(@cmdcolor, 6))
  35.                         console(color(7).@player.' used '.color(8).'('.@cmd[0].') '.color(@cmdcolor).@lastcmd, false)
  36.                 )
  37.         default:
  38.                 if(@sendcmd == true,
  39.                         if(has_permission(@player, 'commandhelper.alias.see.is.alias'), null,
  40.                                 assign(@cmdcolor, '7')
  41.                         )
  42.                         msg('> '.color(@cmdcolor).@cmdevent[command])
  43.                 )
  44.                 if(@consolecmdshow == true,
  45.                         console(color(7).@player.' used '.color(@cmdcolor).@cmdevent[command], false)
  46.                 )
  47.         #Save the last command this player used.
  48.                 export('chHelperz.player.'.@player.'.last.command', @cmdevent[command])
  49.         }
  50. )
Language: commandhelper
Posted by CypherNova139 at 18 Jan 2016, 12:10:40 UTC