Crowd Control Plugin?

Discussion in 'Archived: Plugin Requests' started by PureLiquid, Dec 2, 2012.

  1. Offline

    PureLiquid

    Hello everybody!
    Me & the server i'm in are currently working on a drugsserver. We already got a plugin for using drugs, but we are looking for something usefull the cops can use. Something like Crowd Control weapons? ;)
    The weapons we are thinking of are :
    Flashbangs : A snowball that will give players in a 5 block radius blindness & slowness
    Teargas : A throwable Ghast tear that wil make players in a certain range puke out all of their items
    Stunguns : This will turn a certain item (A golden tool or something?) into a small weapon that uses 1 sulphur for every shot, and will lock the hitted player in place for a configurable amount of seconds?


    We weren't able to find any plugin like this, so that's why i'm requesting one here.

    Cheers,
    PureLiquid :)
     
  2. Offline

    nxtguy

    Sounds like a cool idea. I'll try and make it. Probably wont go far as I'm still very new at plugin developing. :p
     
  3. Offline

    PureLiquid

    Thanks! This might be usefull for other drugservers as well :D
     
  4. Offline

    chasechocolate

    Freakin' awesome idea! :p I could do this, but I have been busy with school and stuff. I already have some of the requested code that I will need to change a bit to do what you want, but I will see what I can do!
     
  5. Offline

    gomeow

    I could contribute code for the "flashbangs"
     
  6. Offline

    CeramicTitan

    I could do this: Teargas : A throwable Ghast tear that wil make players in a certain range puke out all of their items

    Code:JAVA
    1. package me.ceramictitan.test;
    2.  
    3. import java.util.HashSet;
    4. import java.util.Set;
    5.  
    6. import org.bukkit.Bukkit;
    7. import org.bukkit.EntityEffect;
    8. import org.bukkit.Material;
    9. import org.bukkit.entity.Entity;
    10. import org.bukkit.entity.Item;
    11. import org.bukkit.entity.Player;
    12. import org.bukkit.event.EventHandler;
    13. import org.bukkit.event.Listener;
    14. import org.bukkit.event.block.Action;
    15. import org.bukkit.event.player.PlayerInteractEvent;
    16. import org.bukkit.event.player.PlayerPickupItemEvent;
    17. import org.bukkit.inventory.ItemStack;
    18. import org.bukkit.plugin.PluginManager;
    19. import org.bukkit.plugin.java.JavaPlugin;
    20. import org.bukkit.potion.PotionEffect;
    21. import org.bukkit.potion.PotionEffectType;
    22.  
    23. public class test extends JavaPlugin implements Listener{
    24.  
    25. public Set<Entity> items = new HashSet<Entity>();
    26.  
    27. public void onEnable(){
    28. PluginManager pm = getServer().getPluginManager();
    29. pm.registerEvents(this, this);
    30. }
    31. @EventHandler
    32. public void onInteract(PlayerInteractEvent event) {
    33. if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK){
    34. Player player = event.getPlayer();
    35. if (player.getItemInHand().getType() == Material.GHAST_TEAR) {
    36. //Frag Grenades
    37. final Item grenade = event.getPlayer().getWorld().dropItem(player.getEyeLocation(), new ItemStack(Material.GHAST_TEAR));
    38. grenade.setVelocity(event.getPlayer().getEyeLocation().getDirection());
    39. player.getInventory().removeItem(grenade.getItemStack());
    40. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
    41. @Override
    42. public void run() {
    43. grenade.setLastDamageCause(null);
    44. for(Player ppl : Bukkit.getServer().getOnlinePlayers())
    45. if(ppl.getLocation().distance(grenade.getLocation())<=5){
    46. for(ItemStack i : ppl.getInventory().getContents()){
    47. if(i != null){
    48. ppl.getWorld().dropItemNaturally(ppl.getLocation(), i);
    49. ppl.getInventory().remove(i);
    50. ppl.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 10*20, 4));
    51. items.add(grenade);
    52. }
    53. }
    54. }
    55. grenade.playEffect(EntityEffect.WOLF_SMOKE);
    56. grenade.remove();
    57. items.remove(grenade);
    58. }
    59. }, 60L);
    60. event.setCancelled(true);
    61. }
    62. }
    63. }
    64. @EventHandler
    65. public void onItemPickup(PlayerPickupItemEvent event){
    66. if(items.contains(Material.GHAST_TEAR)){
    67. event.setCancelled(true);
    68. }
    69. }
    70. }
     
  7. Offline

    PureLiquid

    Wow, great that all of you are interested in a plugin like this! :D I also thought of another option if that's not to hard to code in, particles?
    Like smoke particles on impact of the flashbang and teargas? :)
     
  8. Offline

    gomeow

    Yes, that could be done
     
  9. Offline

    PureLiquid

    Any progress? It's been quite a while since the last post.. :S
     
  10. Offline

    madmac

    your idea is stolen and kept for personal use

























    Just kidding.....
     
  11. Offline

    creepycrafter4

    is this still in progress?? I would like it! [diamond]:D[diamond]
    [diamondblock]
     
  12. Offline

    PureLiquid

    I would like to know if anyone is currently working or has developped any code for this as well D:
     
  13. Offline

    Rprrr

    PureLiquid
    I was working on this, I made like 2 of the things you requested (flashbang and teargas). I didn't finish it though, I might work on it later.
     
  14. Offline

    PureLiquid

    Great to hear :)
     
  15. Offline

    creepycrafter4

    I totally agree
     

Share This Page