Need some help

Discussion in 'Plugin Development' started by Jbitters3, Nov 4, 2012.

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

    Jbitters3

    I making a plugin and I made classes for certain ranks and they dont get them when the join a team. Also I want them to get the classes and wool heads when they join an arena. I also need help with making currency system for my plugin and giving a random TNT to random person on one team but the other team cant pick it up and the item never despawns. Please add me on skype jbitters3 it would be easier or reply on here and please show some actual code.
     
  2. Offline

    fireblast709

    Are you developing this yourself or is it a plugin request? If it is the first, posting some code as well would get you more help :3
     
  3. Offline

    gomeow

    Why don't you hook into Vault for economy?
     
    fireblast709 likes this.
  4. Offline

    Jbitters3

    See my plugin guy was teachng me stuff but he wont be on for 2 months and I need to finish this plugin but I dont have the greatest plugin expertice.
     
  5. Offline

    gomeow

    Show what code you have, and we will probably be able to help you
     
  6. Offline

    Jbitters3

    Well Im asking for ful length codes:
    I need to know how to create spawns for two different teams
    Code:
     package me.jbitters;
     
    import java.util.ArrayList;
    import java.util.List;
     
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.Material;
    import org.bukkit.World;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Entity;
    import org.bukkit.entity.Player;
    import org.bukkit.entity.TNTPrimed;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockPlaceEvent;
    import org.bukkit.event.entity.EntityExplodeEvent;
    import org.bukkit.event.entity.PlayerDeathEvent;
     
    public class PlayerListener implements Listener {
     
    public SearchAndDestroy plugin;
     
    public PlayerListener(SearchAndDestroy SnD) {
      this.plugin = SnD;
    }
     
    @EventHandler(ignoreCancelled = true)
    public void onPlayerDeath(PlayerDeathEvent e) {
      Player pKilled = e.getEntity();
      Entity eKiller = pKilled.getKiller();
      String pKilledName = pKilled.getName();
     
      if (eKiller instanceof Player) {
      Player pKiller = (Player) eKiller;
      String pKillerName = pKiller.getName();
      // Should say the weapon the player was killed by, not exactly sure
      e.setDeathMessage(plugin.announcementPrefix + pKillerName
        + "killed " + pKilledName + " with a "
        + pKilled.getLastDamageCause().toString());
     
      int pKillerKills = plugin.playerKills.get(pKillerName);
      pKillerKills++;
      plugin.playerKills.put(pKillerName, pKillerKills);
     
      if (pKillerKills == 2) {
        Bukkit.broadcastMessage(plugin.announcementPrefix + pKillerName
          + " is on a 2 killing spree!");
      }
     
      }
     
    }
     
    @EventHandler(ignoreCancelled = true)
    public void onBlockPlace(BlockPlaceEvent e) {
      Block block = e.getBlock();
      if (block.getType() == Material.TNT) {
      World world = e.getPlayer().getWorld();
      Block block2 = world.getBlockAt(new Location(world, block.getX(),
        block.getY() - 1, block.getZ()));
      if (block2.getType() == Material.OBSIDIAN) {
        Entity tnt = world.spawn(e.getBlock().getLocation(),
          TNTPrimed.class);
        ((TNTPrimed) tnt).setFuseTicks(900);
      }
      }
    }
     
    @EventHandler(ignoreCancelled = true)
    public void onEntityExplode(EntityExplodeEvent event) {
      if (event.isCancelled())
      return;
      List<Block> blockList = new ArrayList<Block>();
      blockList.addAll(event.blockList());
      for (Block block : blockList) {
      event.blockList().remove(block);
      }
     
      // Check the location of the bomb detonation site
     
      // if(location = bombALocation) announce Bomb A as Detonated, same with
      // B
      Bukkit.broadcastMessage(plugin.announcementPrefix
        + "The bomb has detonated!");
    }
     
    }
    I need to make sure that TNT can only go on the define Obsidian blocks and make sure it can be picking up by the other team and it has to be given to some randomly and say You have the bomb! Also how to give games time limites and make them start over again.
     
Thread Status:
Not open for further replies.

Share This Page