Disable PVP in guild

Discussion in 'Plugin Development' started by mateuszhp, Nov 4, 2013.

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

    mateuszhp

    Hi, i writing guilds for my server, but i don't know how to disable pvp in members of the guild.

    Please HELP ME!
     
  2. Offline

    Warreo

    In your EntityDamageByEnity method, check if the attacker is part of the same guild as the defender, if so cancel the event. :)
     
    mateuszhp and Mathias Eklund like this.
  3. Offline

    mateuszhp

    Thanks, but on my server, it is 260 players on PVP, so checking in players config if the attacker is member of guild it's laggy :/ Any other way?
     
  4. Offline

    RainoBoy97

    No, there's no other way. There's kinda a way, where you cache the data in a Map/Set then check from that.
     
  5. Offline

    Warreo

    Simple, don't read everything from a file just store it all in a variable much much much faster! :) For example something like this:

    Code:java
    1. HashMap<String,ArrayList> guilds = new HashMap();
     
    mateuszhp likes this.
  6. Offline

    mateuszhp

    Hmm, thanks for idea.

    Warreo BIG THANKS! :)
     
  7. Offline

    Warreo

    mateuszhp

    No probs! Never read file when you don't have to, it will cause crazy lag! :)
     
Thread Status:
Not open for further replies.

Share This Page