Compass pointing to the nearest player

Discussion in 'Archived: Plugin Requests' started by AcedGod, Jun 5, 2012.

  1. Offline

    AcedGod

    Hi
    My friends and I wish to play a large custom map for the Hunger Games. I don't want the game to last forever, so I hope that I can find a plugin that has a compass which points to the nearest player.

    What I want
    -Compass points to the nearest player
    -Compass can only track one player (Nearest Player)
    -Does not track ops

    Hopefully it can be done within 2 days?

    ~I really, really, really thank you in advance

    -Ace
     
  2. Offline

    chenr1

    Hmnn. I wouldnt mind taking a look at it. Maybe you should consider a client side mod. Look up tracers.
     
  3. Offline

    AcedGod

    No, I don't want a mod because the only tracers I can find are ones which can see through blocks.
     
  4. Offline

    rileysut8991

    I think I can do it.
    I'm new to this but I'm not new to java so I'm learning pretty fast
    I'll contact you tommorow
     
  5. Offline

    izak12345678910

    This has been done before but its says [HungerGames] and points to player nearest to you with a customizable distance
     
  6. Offline

    AcedGod

    I think that that plugin generates a random map which I do not want.

    Thanks

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

    izak12345678910

    No it doesn't its just a small plugin when you right click with compass it says [HungerGames] Now tracking player AcedGod and thats about it you can customize the distance and no commands or permissions
     
  8. Offline

    AcedGod

    Could I have a link please?

    Ok I found it although it's not exactly how I wanted it.

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

    izak12345678910

    Let me see if you have the right link? What is missing?
     
  10. Offline

    AcedGod

    I got it from here
    http://dl.dropbox.com/u/29941160/PlayerTracker-0.2.jar

    What I'm missing is that
    -It doesn't ignore ops
    -I don't want it to display a message
    -I want it to be enabled 100% of the time
     
  11. Offline

    zecheesy

  12. Offline

    izak12345678910

    Its public we can use it if we want to... and AcedGod ask the developer in the thread or private message him and if you do get it mind sharing an update with me?
     
  13. Offline

    AcedGod

    He said he'll try to see what he can do by monday.
     
  14. Offline

    izak12345678910

    Well ok thats goos then i guess wait till then and see what happens
     
  15. Offline

    MiniUSB

    Nice concept! I think someone already beat me to it, so I won't try.
    But still, I really like your concept.
     
  16. Offline

    YoshiGenius

    I can do this right now. I'll have all the features you want in it.

    So no pointing to ops EVER, or do you want a permission node to allow people to see where ops are, OR do you want a permission node to hide them?
     
  17. Offline

    AcedGod

    Thanks but another person has answered my request and is trying to help me at the moment.
     
  18. Offline

    izak12345678910

    Do you know when it will be ready?
     
  19. Offline

    AcedGod

    I have it now but I have not tested it yet.
     
  20. Offline

    TheFluffey

    Share with the rest of us?
     
  21. Offline

    Codisimus

    I coded this like a month ago, maybe someone here will find it useful. It takes the list (array) of players and points their compass to the nearest person in the list. This should be put inside a scheduler that repeats every second or tick (how ever often you want). This requires no clicking and is always set to the nearest player.
    Code:
        public static void updateCompases(Player[] players) {
            for (int i = 0; i < players.length; i++) {
                Location l = players[i].getLocation();
                double shortestDistance = 99999;
                int nearestPlayer = i;
                for (int j = 0; j < players.length; j++) {
                    double distanceToPlayer = l.distance(players[j].getLocation());
                    if (distanceToPlayer < shortestDistance && i != j) {
                        nearestPlayer = j;
                        shortestDistance = distanceToPlayer;
                    }
                }
               
                players[i].setCompassTarget(players[nearestPlayer].getLocation());
          }
        }
     
    bobacadodl and AcedGod like this.
  22. Offline

    AcedGod

  23. Offline

    bobacadodl

    Thanks Codisimus! I was trying to something else with compasses and your code helped me :)
     
    Codisimus likes this.
  24. Offline

    pzxc

    I liked this idea so much I had to add it as a feature in my plugin: http://dev.bukkit.org/server-mods/vitals-plugin/

    In the config under mechanics mods set usefulcompass: true, then compasses will ALWAYS work like that, pointing to the nearest player (if there is one). It properly checks for multiworlds and only tries to point to the nearest player in your current world.
     

Share This Page