Minigame help!

Discussion in 'Plugin Development' started by krists23, Nov 3, 2013.

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

    krists23

    Hello,
    Please someone can tell me how to make coin system in minigame, when you kill player to your coins adds 10 coins. Coins you can see with command /pp coins and you can spend your coins in shop.
     
  2. Offline

    Blah1

    On player join, do this (on my phone so go easy on me)
    getConfig().set(event.getPlayer().getName().toLowerCase() + "coins", 0);
    If you don't want it in the config, then just make a settings manager etc.

    Next you want to add 10 coins when event (x) happens. So do this:
    int i = getConfig().getInt(event.getPlayer().getName().toLowerCase() + "coins");
    getConfig().set(event.getPlayer().getName().toLowerCase() + "coins", i + 10);

    And finally to check a players balance you just do
    player.sendMessage("balance: " + i);

    Making an actual shop will be quite hard though. What kind of shop will it be?
     
  3. Offline

    krists23

    Inventory shop ;)
     
  4. Offline

    Blah1

    Then it shouldnt be that hard. Go ahead and get started on the economy then when you get to the shop part go ahead and make another thread or send me a pm :)
     
  5. Offline

    DailyLove

    krists23 Use a database to store an int, and subtract or add the players int whenever an event is ran.
     
  6. Offline

    krists23

  7. Offline

    wouterrr

    A better idea is to make a hashmap with the playername and the amount of coins which will be increased by killing a player and when the minigame is over store it into the database, much faster ;)
     
Thread Status:
Not open for further replies.

Share This Page