Second Life Plugin Idea

Discussion in 'Archived: Plugin Requests' started by imyussy, Sep 7, 2014.

  1. Offline

    imyussy

    Plugin Name: Extra Life

    Description: This plugin will allow players to get their stuff back when they die. The same kind of thing should pop up when you die and it asks you if you want to 'Respawn' or go to the 'Title Screen'. After they click 'Respawn', another thing will pop up asking them if they want to get their stuff back when they respawn. It will let them click 'Yes' or 'No'. Make sure the armor they are wearing gets included when they respawn with their items. Also add a cool down in the config where they can only use it in a certain amount of time. Players will only get this feature if they have the permission node: extralife.use

    Thank you,
    imyussy
     
  2. Offline

    DotDash

    Bukkit can't make that pop-up. You'll have to use a different way.

    Also, who wouldn't want their stuff back?
     
    PapiDimmi likes this.
  3. Offline

    imyussy

    Oh.is there a way to send them a message in chat after they die and respawn asking them if they want to get their stuff back. If you can do that, that would be great! And I know everyone will want their stuff back so that's why I would make this a donor perk. That's why I require the permission node. Also, there would be a cool down before doing it again so if they die but don't lose anything important, then die later with stuff that is important I would want them to be able say if they don't care weather they lose it or not. That's why.
     
  4. yes. if you use OnPlayerDeath and cast it to "e" it's just e.getPlayer().sendMessage("message here");
    I think this plugin would be rather easy to make. I'd recommend trying it yourself, but if you want me to, I can.
     
  5. Offline

    imyussy

    So all I would do is write 'e.getPlayer().sendMessage("message")' in Eclipse? Cuz I don't only want players to get a message in the chat. I need to have it so when they type 'yes' it gives them their items and armour they are wearing back in their inventory, and when they type 'no' it will not give them the stuff. Also when they type 'yes' it should say something like; "&f[&bDiamond-MC&f]: &aYour items have been received again. You must wait 'x' hours before using this again". Since I don't know how to write java I would not know how to do all this. It would be great if you made this for me. Thank you, imyussy
     
  6. I was working on it... The airforce gives me enough time to do stuff like this :)

    this is more of what the actual methods look like. Now I know the playerLife method isn't what you want, it's just the easiest testing method.
    Of course you'd have to have the hashmaps defined too.

    Code:java
    1.  
    2. @EventHandler
    3. public void playerDeath(PlayerDeathEvent e)
    4. {
    5. Player p = e.getEntity();
    6. String pName = p.getName();
    7. e.getDrops().clear();
    8. armourContents.put(pName, p.getInventory().getArmorContents());
    9. inventoryContents.put(pName, p.getInventory().getContents());
    10. p.getInventory().clear();
    11. }
    12.  
    13. @EventHandler
    14. public void playerLife(PlayerInteractEvent e)
    15. {
    16. Player p = e.getPlayer();
    17. String pName = p.getName();
    18. if (e.getClickedBlock().getType().equals(Material.DIRT) && e.getClickedBlock().getType() != null)
    19. {
    20. p.getInventory().clear();
    21. p.getInventory().setContents(inventoryContents.get(pName));
    22. p.getInventory().setArmorContents(armourContents.get(pName));
    23. }
    24.  
    25. }
    26.  


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

    imyussy

    Thank you so much for putting your time and effort into making the plugin. Now since I don't know how to write java I don't really know much about it. But when you finish the plugin would you be posting it on your page or would you be letting me download it another way?
     
  8. Honestly I feel bukkit won't be "approving" any new plugins, so you'll just need to download it.
     
  9. Offline

    imyussy

    Also, I have a question. When the player dies and there stuff drops and the players types 'yes' to keep their stuff, will the person that picks their stuff get that stuff cleared from their inventory afterwards or not? Because then both players will have the items that were dropped. Also, if the person dies and types 'yes' but nobody picks it up, will it get cleared from the ground? Because this needs to be done. If someone picks the stuff up their inventory must be cleared only of the items that were just picked up from the dead player. And what does the playerLife method have that I wanted? Because as I said before, I don't know how to write or read code. Thank you, imyussy
     
  10. Actually when the person dies the PlayerDeathEvent drops the items to the ground. So I cancelled it with
    Code:java
    1. e.getDrops().clear(); // Removes the player's drops

    The playerLife method is nolonger in use, it was for testing to give the items back. Now this method giveInventory is used instead.
    Code:java
    1. public void giveInventory(Player p)
    2. {
    3. String pName = p.toString();
    4. p.getInventory().clear();
    5. p.getInventory().setContents(inventoryContents.get(pName));
    6. p.getInventory().setArmorContents(armourContents.get(pName));
    7. dead_users.remove(p);
    8. armourContents.remove(p);
    9. inventoryContents.remove(p);
    10. }


    It will clear the players inventory then give their stuff back after they type a response in chat, similar to the way Buycraft did it.

    Well anyway you can test the plugin so far. I have it available on my website. It however will not have cool-down. It's simply you die, I ask if you want your stuff. I'll add more after Personal Training in the morning...

    http://plugins.divinedynasty.net/demo/

    If you need more, skype me "MatthewEnderle"
     

Share This Page