killstreaks help

Discussion in 'Plugin Development' started by Retrosize, Dec 14, 2014.

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

    Retrosize

    hello i currently have this:
    Code:
    public class PlayerListener implements Listener {
        public PlayerListener(Main plugin){
            plugin.getServer().getPluginManager().registerEvents(this, plugin);
        }
    along with a killstreak sort of event but i want to know how can i set it so when the player dies their killstreak sets to 0
     
  2. Offline

    tcvs

    @Retrosize Well you are going to need to give us a lot more code to see what you are doing. That snippet of code does not tell us much. We need to see how you are tracking their kill streaks.
     
  3. Online

    timtower Administrator Administrator Moderator

  4. Offline

    pookeythekid

    @Retrosize To elaborate on Timtower's answer:
    Code:java
    1. public class PlayerListener implements Listener {
    2. public PlayerListener(Main plugin) {
    3. plugin.getServer().getPluginManager().registerEvents(this, plugin);
    4. }
    5.  
    6. @EventHandler
    7. public void playerDeath(PlayerDeathEvent ev) {
    8. yourScoreMap.put(ev.getPlayer(), 0);
    9. }
    10. }

    This is not at all complete. You have to do whatever your plugin needs if you want this class to be finished.
     
  5. Offline

    3ShotGod

    http://wiki.bukkit.org/Plugin_Tutorial#HashMaps_and_How_to_Use_Them
     
  6. Offline

    Gingerbreadman

    @3ShotGod Use a HashMap to store the Player's name and his current kill streak, and when he dies reset the HashMap xD
     
  7. Offline

    3ShotGod

    Im not the one who needs that lol
     
Thread Status:
Not open for further replies.

Share This Page