Minecraft codes with IConomy?

ga
2

Hello people I have a question and although I'm just doing an adminshop coden

and now I have the problem that I do not know how I draw someone money and give money I would be happy if someone can help me with this or would recommend a different money system which is easier

em

Create a HashMap (key: name of the player, value: player's money)
After each start you should load them (using ArrayList) so that the money stays current *
Every time a player buys something, you use his name as a key to get the money, then you do other checks, and if it's all right, you pull the money off and put it back in the HashMap
After each (re / de) activation, you should of course save the HashMap, so that the counter does not start again at 0

Of course, it is not recommended to save the HashMap, but an ArrayList, when starting the server, you load all the values in the HashMap.

Br

You can do it as max0028 wrote, but as I understand it, you want to do it with IConomy.

Importing Iconomy and then there's certainly a method that retrieves / reduces / increases the player's money.

Then you do not have the whole HashMap nonsense.

However, if you codest your own CoinSystem, which you do not want according to your question, then you can do that with ArrayLists u. Make Hashmaps.