Multiple args or command

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Deku

Member
Jul 12, 2020
36
0
6
19
How can I make sure that in a command there is a command (/ roles) that by adding different args (doctor, soldier) gives me different answers?

There is my code on command:

Code:
        if(cmd.getName().equalsIgnoreCase("roles")) {
            if (args.length == 1) {        
                if (args[0].contains("0")) {        
                    sender.sendMessage(main.getInstance().getConfig().getString("ruolo.medico").replaceAll("&", "§"));    
            }
            }
Main code:
Code:
package comr;

import org.bukkit.plugin.java.JavaPlugin;

public class chunk extends JavaPlugin {
 
    public static chunk plugin;
 
       public void onEnable() {    
           plugin = this;        
           getCommand("roles").setExecutor(new comand ());                
           this.saveDefaultConfig();        
       }

       public void onDisable() {
           System.out.println("§9a");
       }
         public static chunk getInstance() {
            return plugin;
    }
         public void onReload() {    
           reloadConfig();        
           plugin.getServer().getPluginManager().disablePlugin(plugin);
           plugin.getServer().getPluginManager().enablePlugin(plugin);              
       }
}
 
Use the String#equals and String#equalsIgnoreCase methods and the length of the argument array.
 
[QUOTE = "Blue, post: 53031, member: 6298"] Utilizza i metodi String # equals e String # equalsIgnoreCase e la lunghezza dell'array di argomenti. [/ QUOTE]
thanks youu