Team Plugin Help

Discussion in 'Plugin Development' started by Smittayy, May 11, 2013.

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

    Smittayy

    I'm currently trying to code my own plugin that upon entering a Team DeathMatch portal, it randomly assigns you to one of two teams red or blue but you're only on one of those teams while you're in the arena.

    What I am aiming for my plugin to do:
    Randomly picks team for player
    gives player certain items
    Tells you how many people are in that game on a sign next to the portal
    No friendly fire
    Also creates an arena out of an area I have already built.



    I know that the scoreboard API has a team function with friendlyfire and the option to set teams and what not but I'm not sure if I could implement what I want with this API as I am already using a custom made plugin that uses the Scoreboard API for something else. So i'm not 100% sure if I could add what I want with that code as well.

    So my question is how would I go about this? I am not that WELL with java but I do know how to figure some things out.

    Many thanks!
     
  2. Offline

    TGF

    Smittayy Maybe with permissions?
    Player who entered the portal is rewarded with permission team.red or blue
    And on attack event if You and attacked player have the same permission event is cancelled.
     
  3. Offline

    chasechocolate

    I would personally use some list to store players on each team. Store their name in a List<String>.
     
  4. Offline

    Ad237

    Create 2 lists like this:
    Code:
    ArrayList<String> team1 = new ArrayList<String>();
    ArrayList<String> team2 = new ArrayList<String>();
    Then when you need to add a player to a team use this:
    Code:
    team1.add(player.getName())
     
  5. Offline

    dsdsds123

    or hashmaps... it helps id say, if you want multiple arenas you should use hash map's:
    the key would be the arena name and the value would be the players name

    Code:
    HashMap<String, String> team1 = new HashMap<String,String>();
    HashMap<String, String> team2 = new HashMap<String,String>();
     
  6. Offline

    Smittayy

    Alright, so I'm going to go with a hashmap because I am going to have multiple arenas in my server.

    Code:
    HashMap<String, String> team1 = new HashMap<String,String>();
    HashMap<String, String> team2 = new HashMap<String,String>();
    How would I go about using this^?

    I believe I would need to make some sort of arena plugin before I could make this team plugin correct?
     
Thread Status:
Not open for further replies.

Share This Page