[pvp] SimpleKillStreak [Formatted]

Discussion in 'Archived: Plugin Requests' started by migsthegod, Dec 17, 2011.

  1. Offline

    migsthegod

    Plugin category: PVP

    Suggested name: SimpleKillStreak

    A bit about me: Just a server owner that wants to suggest a simple but cool plugin :)

    What I want: Nothing fancy. I was just thinking of having a plugin that announces a "message" when a player gets a "#/amount" of player kills in a row without dying.

    Ideas for commands:
    /ks 'x' 'message'
    -where 'x' is the number of kills in a row which when reached announces 'message'

    ****command is optional****
    if keeping it simple means just using a config file that would be fine.
    as long as messages are customizable :D

    Ideas for permissions: A simple "killstreak.allow" and "killstreak.configure/admin" is enough?

    Willing to pay up to: $1 :D

    When I'd like it by: "Yesterday, though obviously it'll take a while before anyone more than a few takes notice of this post, I'll keep bumping it." :D

    Devs who might be interested in this: wouldnt know
     
  2. Offline

    KaiBB

    I might take this up. Seems simple enough. The only thing I see as a problem would be the command you suggest of changing the value, and the permissions. If I get this right, you want when someone gets a set amount of kills to be broadcasted in a message saying something like "KaiBB has 3 kills!" ? And will the permission allow for the message to be broadcasted? And last but not least, when you say "change "kill streak value"", do you mean the total kills, or the amount of kills in a streak?

    EDIT: And if the player gets killed, do you want the total kills reset?
    EDIT: So with the command you want to change the amount of kills in said streak?
     
  3. Offline

    migsthegod

    Hi thanks for the interest! Couldn't find the quote button

    " If I get this right, you want when someone gets a set amount of kills to be broadcasted in a message saying something like "KaiBB has 3 kills!" ? "
    Yes that would be awesome

    "And will the permission allow for the message to be broadcasted?"
    Yeah. So that for example: only [VIP members] get killstreaks broadcasted.

    "when you say "change "kill streak value"", do you mean the total kills, or the amount of kills in a streak?"
    Ah yes kills in a streak, without dying. **also edited the main topic :D

    EDIT: And if the player gets killed, do you want the total kills reset?
    That would be awesome

    Again thanks for the interest! and goodluck! :)
     
  4. Offline

    KaiBB

    I've started on this, but it won't be ready immediately, as I don't know how to set the command or permissions you specified.
     
  5. Offline

    migsthegod

    Great! Thanks man!

    BTW, the command is optional. I realize that might make it not "Simple"

    A config where the message can be customized is enough? :)
     
  6. Offline

    KaiBB

    I'll try my best. I'm relatively new to plugin development, but I see how this would be done :)
     
  7. Offline

    migsthegod

  8. Offline

    KaiBB

    If only it was open source T_T
    Sorry, it'll take a while. Nobody seems to know how to get the attacker on death... When I find that one hthing out it'll be done -_-
     
  9. Offline

    KillerSmurf

    there is onEntityDamage and onEntityDamageByEntity
    //the attacker
    event.getDamager();
    //the defender
    event.getEntity();

    if (event.getEntity().isDead()) {
    CLASSOBJECT.addKillStreak(1); something something...
    }
     
  10. Offline

    Rahazan

    Nobody knows?! I answered a thread with the solution today, created by you!
    This is basically 90% of the difficulty of the plugin right here, handed to you.

     
  11. Offline

    KaiBB

    Thanks

    Can you point me to this thread? Don't think it was mine.

    Nevermind
    It was my thread. Forgot to watch it -.-

    How do you use CLASSOBJECT? Would I rename it to the class containing what to do with the attacker?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 22, 2016
  12. Offline

    Rahazan

    ...? Why not use my code?
     
  13. Offline

    KaiBB

    I did use your code. I now need to tell it to add 1 to the killstreak :p

    EDIT: The reason I need to get help with adding 1 to the killstreak is, well, I'm TERRIBLE at learning plugin dev, I'm not good at tearing apart open-source and learning from it :p
     
  14. Offline

    KillerSmurf

    Yes so if I had a class called KillStreakManager.java

    and inside of it contained flags...but you probably don't have that so you will have a hash map inside of your main class file:

    public Map<Player, Integer> killstreak = new HashMap<Player, Integer>();
    int number = 0;
    if (event.getEntity().isDead()) {
    number += 1;

    MainClassObjectReference.killstreak.put((Player) event.getDamager(), number);
    .....logic code....logic stuff

    if (
    MainClassObjectReference.killstreak. magical stuff to get the killstreak > 5){
    broad cast message: 5 kill streak sddasdsdds
    }
    }

    Ugh...Trying to code in this small chat box with out auto indent :|

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 22, 2016
  15. Offline

    Rahazan

    Alright, you might want to create hashmap with the player (killer) as the key and an integer value of the amount of kills.

    public Map<Player, Integer> isIngame = new HashMap<Player, Integer>();
    You could use this and put it at the top of your class.


    You will want to see if the player is already in the hashmap, if not, add the player and set the value to 0 (zero).
    If he already is, you will want to get the value and add 1 to it and put it back in the hashmap.
    You will also want to check if the integer is above a certain level to broadcast a message.
     
  16. Offline

    KaiBB

    What would I insert where you typed "magical stuff to get the killstreak"?
     
  17. Offline

    Rahazan

    If you need, I could explain it to you live over teamviewer / whatever.
     
  18. Offline

    KaiBB

    Could we do a TeamViewer meeting? I can listen to you speak with headphones, but I can't talk, the folks are asleep. :p
     
  19. Offline

    Rahazan

    That could work.
     
  20. Offline

    KaiBB

    Click Start Instant Meeting, then invite me to it by copying the link to clipboard.
     
  21. Offline

    Rahazan

    m86-015-994
     
  22. Offline

    dbizzzle

    I could help with this if you guys don't get it working.
     
  23. Offline

    KillerSmurf

    I already have it done, not going to ruin it for him though.
     
  24. Offline

    dbizzzle

  25. Offline

    Rahazan

    Don't worry, I would've been able to code this in under 10 minutes ;P Just wanted to have him actually understand it.
     
  26. Offline

    KaiBB

    I give Rahazan 100% credit. He LITERALLY took over on this one. Go TeamViewer (;
    I'll give you a link momentarily.

    <Edit by Moderator: Redacted mediafire url>

    EDIT: Added the fixed Config, just copy all the files inside of the .rar to your plugins folder.
    Read the other posts on the 2nd page, too.

    Thanks for all the help, guys. I at least doubled my knowledge of Java doing this.

    Almost forgot:
    In the config, the minimum number of kills to start a streak is 3. If you want to change this, make it one less than the number you want. If you want the streak to start at 5, put 4.

    EDIT: Didn't realize you wanted the message changed. I'll get on that right now :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 11, 2016
  27. Offline

    migsthegod

    woah
    you guys just turned an idea into a reality :D
    *respect*

    thanks guys!
    hope to see more of this :D
     
  28. Offline

    KillerSmurf

    I said use a hashmap
     
  29. Offline

    dbizzzle

Share This Page