Hi, i have this idea for my server and i am not the best with java, what i need is a plugin that would simply log a player name to a file upon entering command, complexity dose not matter once it does just that. I would just modify command/permissions and i would be set for the idea i have. thanks in advance,
@timtowerdoes does not matter just anything, i can easily modify once i decide all that needs to be done is the player enters a certain command /command here if the player has permission (i can add perms if you want to save time) then the name will be logged to a file of your choice
Arrxzon It isn't that hard to be honest, get a list from the config, add the current player, save the list again.
Arrxzon Do you mind explaining the main point of this plugin? Is it for administrative purposes? Or just purely to log who is using a command? I was thinking of doing a plugin similar to this but I haven't found the motivation yet.
Something like this? Code:java public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ if(sender instanceof Player){ Player player = (Player) sender; if(commandLabel.equalsIgnoreCase("addname")){ if(args.length>=1){ getConfig().set(player.getName(), args); this.saveDefaultConfig(); saveConfig(); player.sendMessage(ChatColor.GREEN + "You have added your name to the list!"); } else{ player.sendMessage(ChatColor.DARK_RED + "You must include your name!"); }
That would create a config file that looks like Code: Yourname: Yourname for each user. Are you looking to create a list of names like: Yourname, Yourname1, Yourname2?