~/paste/19058
~/paste/19058
~/paste/19058

  1. #chHelperz aliases.msa ver 1.0
  2. everyone:/repeat [$action] = >>>
  3. @player = player()
  4. switch(to_lower($action)){
  5.         case printrepeatcommand:
  6.         case printrepeatcmd:
  7.         case printrepeat:
  8.         case showrepeat:
  9.         case hiderepeat:
  10.         case showr:
  11.         case hider:
  12.         case pr:
  13.                 assign(@setting, get_value('chHelperz.player.'.@player.'.command.show'))
  14.                 if(@setting == true,
  15.                         #disable
  16.                         store_value('chHelperz.player.'.@player.'.command.show', false)
  17.                         export('chHelperz.player.'.@player.'.command.show', false)
  18.                         die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' The command re-run will be '.color(c).'hidden'.color(r).' and not shown to you in the chat.')
  19.                 ,
  20.                         #enable
  21.                         store_value('chHelperz.player.'.@player.'.command.show', true)
  22.                         export('chHelperz.player.'.@player.'.command.show', true)
  23.                         die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' The command re-run will be '.color(a).'shown'.color(r).' only to you in the chat.')
  24.                 )
  25.         case printcommand:
  26.         case printcmd:
  27.         case print:
  28.         case show:
  29.         case hide:
  30.         case printall:
  31.         case p:
  32.                 assign(@setting, get_value('chHelperz.player.'.@player.'.command.show.all'))
  33.                 if(@setting == true,
  34.                         #disable
  35.                         store_value('chHelperz.player.'.@player.'.command.show.all', false)
  36.                         export('chHelperz.player.'.@player.'.command.show.all', false)
  37.                         die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' Any command you run will be '.color(c).'hidden'.color(r).' and not printed back to you in the chat.')
  38.                 ,
  39.                         #enable
  40.                         store_value('chHelperz.player.'.@player.'.command.show.all', true)
  41.                         export('chHelperz.player.'.@player.'.command.show.all', true)
  42.                         die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' Any command you run will be '.color(a).'shown'.color(r).', printed back only to you in the chat.')
  43.                 )
  44.         case consolecmd:
  45.         case console:
  46.         case consolecommand:
  47.         case cc:
  48.                 assign(@setting, get_value('chHelperz.console.command.show'))
  49.                 if(has_permission(@player, 'commandhelper.alias.admin'),
  50.                         if(@setting == true,
  51.                                 #disable
  52.                                 store_value('chHelperz.console.command.show', false)
  53.                                 export('chHelperz.console.command.show', false)
  54.                                 die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' All commands will '.color(c).'NOT broadcast'.color(r).' to the console. This does not affect any command broadcast messages other plugins or the vanilla server may provide.')
  55.                         ,
  56.                                 #enable
  57.                                 store_value('chHelperz.console.command.show', true)
  58.                                 export('chHelperz.console.command.show', true)
  59.                                 die(color(7).'['.color(6).'Command'.color(7).'] '.color(r).' All commands will '.color(a).' be broadcast'.color(r).' to the console. This does not affect any command broadcast messages other plugins or the vanilla server may provide.')
  60.                         )
  61.                 ,
  62.                         die(color(c).'['.color(7).'Command'.color(c).'] '.color(3).'You do not have permissions to use this command.')
  63.                 )
  64.         case nope:
  65.                 die('\n'.moo(color(c).'['.color(7).'Command'.color(c).'] '.color(3).'Unexpected action.'.color(r)))
  66.                        
  67. }
  68.  
  69. if(@player == '~console', die('/repeat'))
  70.  
  71. assign(@lastcmd, import('chHelperz.player.'.@player.'.last.command'))
  72. assign(@showcmd, get_value('chHelperz.player.'.@player.'.command.show'))
  73.         if(@lastcmd == '' || @lastcmd == null,
  74.                 die(color(c).'You have not run a command recently.'.color(r).' Did you just login?')
  75.         )
  76. #List cmd used, with CH aliases showing as a different color.
  77. if(is_alias(reg_split(' ', @lastcmd)[0]), assign(@cmdcolor, 3), assign(@cmdcolor, 6))
  78.  
  79. msg(color(3).'Re-ran your last command.')
  80. if(@showcmd == true,
  81.         if(has_permission(@player, 'commandhelper.alias.see.is.alias'), null,
  82.                 #CH builds < 2964: Repeat cmd prints back the command to run in color code #7
  83.                 @cmdcolor = 7
  84.         )
  85.         msg('> '.color(@cmdcolor).@lastcmd)
  86. )
  87. run_cmd(@lastcmd)
  88. <<<
  89.  
  90. /. [$action] = >>>
  91. call_alias(/repeat $action)
  92. <<<
  93.  
  94. '/\'' [$action] = >>>
  95. call_alias(/repeat $action)
  96. <<<
Language: commandhelper
Posted by CypherNova139 at 10 Jan 2016, 11:14:44 UTC