issue with "execute_mode: FROM_ANOTHER_COMMAND" #328


Open
  • Caley19_ created this issue Feb 5, 2022

    When I run a command that has "execute_mode: FROM_ANOTHER_COMMAND" from another command which has if/elseif statements in the runcmd I get error-message. Example:

     

    SomeCommand:
      command: /somecmd

     type: RUN_COMMAND

     runcmd:

     - '/secret_cmd'

     - '/secret_cmd2'

     - '$text$You run cmds from another cmd!'

     

    SecretCmd:

      command: /secret_cmd

      execute_mode: FROM_ANOTHER_COMMAND

      type: RUN_COMMAND

      runcmd:

      - '$text$This is fine!'

      error-message: "You can't run this command!"

     

    SecretCmd2:

      command: /secret_cmd2

      execute_mode: FROM_ANOTHER_COMMAND

      type: RUN_COMMAND

      runcmd:

      - '$Script$%if%$money>0'
      - '$Script$%PlayerData%hasData=$PlayerData%hasData%'
      - '$Script$%elseif%$money==0'
      - '$Script$%PlayerData%hasData=$PlayerData%hasData%'

      error-message: "You can't run this command!"

     

    The result in chat is:

    This is fine!
    You can't run this command!
    You run cmds from another cmd!


    As you see "$text$some text" in SecretCmd's runcmd worked fine and having just "$Script$%PlayerData%hasData=0" worked fine too(won't show anything in chat), but when I add %if% or %elseif% without any $text$ or anything before/past these statements, you start to get error-message in chat(cmd still get executed just fine, but shows error-message in chat anyway). I have few commands which uses list of %if% statements without any text content or anything else past if/elseif and they spam error-messages in chat, I can fix it by removing FROM_ANOTHER_COMMAND but obviously that is not the right fix, since players can now run cmds which they shouldn't. 

  • Caley19_ edited description Feb 5, 2022
  • Caley19_ edited description Feb 5, 2022

To post a comment, please login or register a new account.