Hello! I am working on a reporting plugin that saves the name of the reported player and the reason why. so in the text file it would look like this...
<player_name>: <reason>
<player_name2>: <reason2>
and so on...
I was watching the tutorial Data Storage - Banning Plugin, and I just need help on how to add the reason to the file and make it work as an argument.
Please help!
Reading more then one argument
Re: Reading more then one argument
Well you reason would be every argument after the first one, so if the command is
something like this could work.
/ban wide_load not being very niceto get the string "not being very nice" you would need to join together all of the argument except the first one which is the name
something like this could work.
StringBuilder builder = new StringBuilder(); builder.append(args[1]); for (int i = 2; i < args.length; ++i){ builder.append(' '); builder.append(args); } String reason = builder.toString();
Re: Reading more then one argument
Oh great! thank you very much! i will probably be back for more help later!
Re: Reading more then one argument
No problemodogollie wrote:Oh great! thank you very much! i will probably be back for more help later!