Points System for KitPVP

Discussion in 'Plugin Development' started by AdityaTD, Feb 8, 2015.

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

    AdityaTD

    Hello guys I have made a KitPVP plugin for my server but I want to add a points system to it like when a player kills another player he get's 1 point and once he has 20 points he can redeem it for a Kit! I wanna use VaultAPI for it! Please Help, it's for my Server Network! Thank you!
     
  2. Offline

    jebbo

  3. Offline

    AdityaTD

    That didn't help is there any other stuff which I can use?
     
  4. Offline

    jebbo

    @AdityaTD
    That should solve your question.

    But here:

    Add this to your main:
    public static Economy econ = null;

    This on your onEnable:

    Code:
    if (!setupEconomy() ) {
                log.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
                getServer().getPluginManager().disablePlugin(this);
                return;
            }
    And this somewhere in your main class:

    Code:
    private boolean setupEconomy() {
            if (getServer().getPluginManager().getPlugin("Vault") == null) {
                return false;
            }
            RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
            if (rsp == null) {
                return false;
            }
            econ = rsp.getProvider();
            return econ != null;
        }
    Now you go to your DeathListener and add this:

    econ.depositPlayer(player, 10); // 10 = 10 Currency

    I got all of this from the Link I sent you.

    That should be it.
     
  5. Offline

    BaconStripzMan

    Tbh, MySQL is the way to go about it. Getting a mysql server isn't expensive, and they're so much easier to work with!
     
  6. Offline

    AdityaTD

    I have a mysql server but idk how to use it... Please teach me! Thank you
     
Thread Status:
Not open for further replies.

Share This Page