[Still Stuck] (Commands Firing Back)

Discussion in 'Plugin Development' started by Unscrewed, May 4, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Unscrewed

    Hey guys!
    Im here again, I'm still stuck on something. :(
    I have been developing a plugin, but when I type any command, it keeps firing back the plugin.yml description and usage. Please help me.

    [​IMG]

    Code:
    name: RolePlay
    version: 0.1
    author: Unscrewed
    main: me.Unscrewed.RolePlay.RolePlay
    commands:
      rp:
        description: Every RolePlay Command
        usage: /<command> - Displays the RolePlay commands
      rp police:
        description: Be a Police Officer
        usage: /<command> - Lets you join this role
      rp robber:
        description: Be a Robber
        usage: /<command> - Lets you join this role
      '911':
        description: Call a Police Officer
        usage: /<command> - Makes you call the police
    
    Command Part in Main Class:

    Deleted to prevent stealing.

    Thanks alot <3

    Yours sincerely,
    Unscrewed

    Someone able to help me? :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 14, 2016
  2. Offline

    Acrobot

    You can't give arguments to plugin.yml. You must parse them by yourself.
     
  3. Offline

    Unscrewed

    I dont get it? Replace "<Command>" with "/rp" or what?
    Thanks for responding btw <3
     
  4. Offline

    Acrobot

  5. Offline

    Unscrewed

    Woow! Thanks again for your quick response, I changed everything to what you said, everything seems OK.
    But eClipse underlines it like this:

    public boolean onCommand(CommandSender sender, Command cmd, Account account, String commandLabel, Player player, String[] args) {
    commandName = cmd.getName().toLowerCase();
    if(sender instanceof Player){ //We don't want the server to change roles :)
    if(commandName.equalsIgnoreCase("rp")){
     
  6. Offline

    Acrobot

    Oh, I'm sorry.
    It should be
    Code:
    String commandName = cmd.getName().toLowerCase();
    
    I forgot the type :)
     
  7. Offline

    Unscrewed

    Still fires back the help :{ :{
    I'll try and see if updating to the iConomy5 helps since the hooks are for iConomy5.
    But it should always give a message :S
    EDIT: Doesnt work :-(
    Why does it keep giving the right syntax.
    I just type: /rp
    "/rp (police|robber)"
    etc.
     
  8. Offline

    Acrobot

  9. Offline

    Unscrewed

    Still doesnt work, even with returns true :(
    Do you have MSN / Skype soo we can talk better?
    I really appriciate everything your doing!
     
  10. Offline

    Acrobot

    @Unscrewed
    Not really, I am currently talking with friend :/
    Can you PM me your code if you believe I won't steal it?
     
Thread Status:
Not open for further replies.

Share This Page