config messages help

Discussion in 'Plugin Development' started by AguilaAudaz, Sep 25, 2013.

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

    AguilaAudaz

    My problem is: I want to make a messages.yml file, and i dont know how to do it, or set to load it, please help me, this is what i have:
    Code:
    public class WarpixelAdminCommands implements CommandExecutor
    {
        Warpixel plugin;
        public WarpixelAdminCommands(Warpixel plugin)
        {
                this.plugin = plugin;
        }
       
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String args[])
        {
            if(cmd.getName().equalsIgnoreCase("wp"))
                  FileConfiguration messagesConfig = getFile("/plugins/Warpixel/messages.yml");
                {
                        if(args.length == 1 && args[0].equalsIgnoreCase("createarena"))
                        sender.sendMessage(ChatColor.RED + "Correct usage /wp createarena [gametype] [name]");
                }
            {
                        if(args.length == 2 && args[0].equalsIgnoreCase("createarena") && args[1].equalsIgnoreCase("tdm"))
                          sender.sendMessage(ChatColor.RED + "Please add a name!");
            }
            {
                        if(args.length == 3 && args[0].equalsIgnoreCase("createarena") && args[1].equalsIgnoreCase("tdm") && args[2].equalsIgnoreCase("test"))
                            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', messagesConfig.getString("arena-created")));
            }
            return false;
     
    }
    }
     
  2. Offline

    drtshock

Thread Status:
Not open for further replies.

Share This Page