[GEN] GiveIt V1.3 A "give" item plugin with more control [1240]

Discussion in 'Inactive/Unsupported Plugins' started by cian1500ww, Feb 5, 2011.

  1. Offline

    cian1500ww

    GiveIt - A "give" item plugin with more control [1240]
    Version: 1.3

    The idea behind this plugin is to allow players to use a special command called "/giveme" which can be controlled.

    By controlled, I mean that the server admin can only allow certain items with a max amount to be given. That way, you won't have players building giant gold structures unless you'd like them to ;)

    You can also restrict an item to a single player for those extra special projects.

    Players are able to see what items are available ingame.

    Players that are added to the mods.txt file, will have the ability to add and remove items from the allowed.txt file ingame.

    They will also have the ability to give other players items.

    The usernames of players that are listed in the blocked.txt file will not be able to use the /giveme command.

    I've been using GiveIt for a while on my server to see how well it worked and so far it's been working quite well so I've decided to release it and share the source code.

    This is my first plugin for CraftBukkit so do go easy on me :p

    Features:
    • Only allow specified items to be "given"
    • Restrict the amount that can be "given"
    • Restrict the giving of certain items to a single player
    • Full logging of every item requested by every player
    • Players can see what items are allowed ingame
    • Mods can add or remove items from the allowed list ingame
    • Certain players can be blocked from using the /giveme command
    • ItemId's don't need to be in the 3 digit format ie. 75 will work instead of 075
    • Support for Permissions plugin v2.5 (Permissions plugin is optional)
    [​IMG]


    [​IMG]

    [​IMG]

    Download:

    Download GiveIt v1.3 Plugin
    Source Code
    Hudson

    Installation Instructions:
    1. Download GiveIt using the link above and place it in your plugins folder
    2. Enable GiveIt by starting your server
    3. GiveIt will automatically create a directory called GiveIt in your plugins folder
    4. In the GiveIt folder there should be a file called allowed.txt
    5. Add a new item to the allowed.txt file by following this:
      1. ItemID=MaxAmount.username
      2. eg. 278=01.cian1500ww
      3. This command allows cian1500ww to give themselves one diamond pickaxe
      4. eg. 278=01
      5. This command allows any player to give themselves one diamond pickaxe
    6. Make sure that you only add one item per line.
    7. The plugin does NOT need to be reloaded after adding items to the allowed.txt file.
    8. Add the usernames of the players to mods.txt that you'd like to have access to the /givemeadd and /givemeremove commands. (Only if you are not using Permissions)
    9. Add the usernames of the players to blocked.txt that you would like to stop from using /giveme. (Only if you are not using Permissions)
    10. Reload the plugin after adding usernames to mods.txt or blocked.txt
    11. A log file called GiveIt.log will be created in the GiveIt folder after the plugins first use.
    Sample allowed.txt file:

    Code:
    #ItemID=Amount.username
    278=01
    052=01
    078=64
    079=64
    066=30
    074=32
    011=10.cian1500ww
    
    Usage Instructions:

    A player can give themselves an item by using the following command:


    Code:
    /giveme <itemid> <amount> <durability>
    Example:
    Code:
    /giveme 052 1
    Note: In version 1.3+, it's possible to /giveme and /giveto items with durability

    An important point to remember is that the item id must always be 3 digits so item 40 will be 040.No longer an issue in V1.2 :)

    If the player requests an item that isn't allowed, they will be notified. Also, if they request too many of one item, they will be asked to choose a lower amount.

    Players can see what items are available by using the following command:
    Code:
    /givemeinfo
    Players that are specified in the mods.txt file, can add items to the allowed.txt file with the following command:
    Code:
    /givemeadd <itemid> <quantiy> <username if required>
    Example:
    Code:
    /givemeadd 278 30 cian1500ww
    Example without username:
    Code:
    /givemeadd 278 30
    They can also remove items from the file using this command:
    Code:
    /givemeremove <itemid>
    Example:
    Code:
    /givemeremove 50
    The /giveto command allows players listed in the mods.txt file to give items in allowed.txt to other players. The command is as follows:
    Code:
    /giveto <playername> <item> <amount> <durability>
    Example:
    Code:
    /giveto cian1500ww 35 10 2
    Permissions Plugin Instructions:


    Add the following permission to the groups or users that you'd like to have access to the "/giveme" command:
    Code:
    giveit.allow

    All users will still have access to the "/givemeinfo" command.

    Add the following permission to the groups or users that you'd like to have access to the "/givemeadd" and "/givemeremove" command:
    Code:
    giveit.modify
    To give users access to the "/giveto" command:
    Code:
    giveit.to
    If you are using Permissions, the mods.txt and blocked.txt files will not be used but will still be generated.
    Changelog:

    Version 1.3:
    • Added support for CraftBukkit build 617
    • Added the /giveto command
    • Added support for durability so players can now set the durability of the item they are spawning
    • Fixed problems where players could give themselves more than the allowed amount
    • Fixed the example command being shown everytime /giveme was used
    • Tested with Permissions v2.5.5
    Version 1.2:
    • Added support for Permissions v2.5
    • Removed TSLPC
    • Added support for builds 254+
    • Ability to add items and remove items from the allowed.txt file ingame.
    • Added a blocked.txt file that will contain a list of usernames that aren't allowed to use the plugin
    • Allowed for the use of item ids that don't begin with 0 ie. 74 instead of 074
    • Allowed for the spawning of item quantities greater than 64
    Version 1.1:
    • Added support for Permissions plugin
    • Improved incorrect command checking
    • Split the code into separate classes and tidied it up a bit
    Version 1.0:

    • Initial Release
    Let me know of any problems here or feel free to drop me an email -> [email protected]


    If you have any ideas or feature requests, please do tell me and I'll do my best to implement them!!
     
  2. Offline

    Don Redhorse

    permission support would be nice, and I would need that older version for now as I'm running 198.
     
  3. Offline

    cian1500ww

    I'll have permission support with 1.1

    I'll upload the older version for builds up to 199 but I won't be upgrading it further so it won't have permission support.
     
  4. Offline

    Don Redhorse

    cool, totally understandable.. I'm waiting for craftbook to update the server as it works atm and bukkit needs to have aliases figured out before I want to make any changes without it.
     
  5. Offline

    cian1500ww

    Updated the original post with the link to the version that supports CraftBukkit builds up to 200.

    Also added some screenshots.

    I plan to have support for permissions in version 1.1 which I hope to have ready within a week. Any other requests or problems, let me know.
     
  6. Offline

    parker_digg

    Good idea for a plugin, I was just in a situation yesterday where I wanted something like this for my moderators!
     
  7. Offline

    cian1500ww

    Thanks!! I got the idea from my own server, lots of people like to build special projects which require large amounts of items that would normally take too long to gather and special projects always help create a unique server :D
    --- merged: Feb 8, 2011 10:12 PM ---
    Updated the plugin to version 1.1 with support for the Permissions Plugin as requested ;)

    Any more ideas or requests, let me know!!
     
  8. Offline

    CJMP

    Hey, Im making a server for some friends, youy should release a list of all the items being allowed.
     
  9. Offline

    cian1500ww

    I think you may have misunderstood how the plugin works, at default setting ie. empty allowed.txt file, there are no items available. Only items that you add to the allowed.txt file will become available.
    Players can see what items are available ingame using the /givemeinfo command.
    Feel free to post any more questions!!
     
  10. Offline

    Marcaus

    can u give me an example of whuts supposed to be in the allowed.txt file?
     
  11. Offline

    henrylee99

    could u make it so that u could spawn everything or just make a .txt download and put all of the ids in it
     
  12. Offline

    cian1500ww

    Put each item that you'd like to allow on a new line so to add 1 diamond pickaxe to the allowed file, add the following line:
    278=01
    So the format is itemid=amount

    Sure, I'll definitely look into that.
     
  13. Offline

    Legoboy1134

    Here is a suggestion: In a future update allow 1 instead of 001. Wouldn't it be easy to check if it was 3 digits, and if not it will just add 1-2 0's and then execute?
     
  14. Offline

    cian1500ww

    I'll have to have a think about that, it's something that the plugin really needs but it's a bit of a head scratcher!!
     
  15. Offline

    Legoboy1134

    I got this error:

    SEVERE: Could not load plugins/GiveIt.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:66)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:117)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:82)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
    at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:193)
    at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:184)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:171)
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:344)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:326)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:114)
    at java.util.jar.JarFile.<init>(JarFile.java:135)
    at java.util.jar.JarFile.<init>(JarFile.java:99)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:53)
    ... 11 more

    And no config file appeared.
     
  16. Offline

    cian1500ww

    What CraftBukkit build are you using??
     
  17. Offline

    Legoboy1134

    My bad. I recently updated to latest CraftBukkit and forgot to pull down new version. Working like a charm. :D
     
  18. Offline

    cian1500ww

    That's what I like to hear!! [​IMG]
     
  19. Offline

    Phase

    The Permissions permissions don't work for me for Craftbukkit build 325, and neither does the regular system of ID=AMOUNT.PLAYER

    The proper group has giveit.allow, and a player in that group is also listed like so: 001=1.PlayerName, but neither are working.

    Any ideas?
     
  20. Offline

    cian1500ww

    When you start the server, do you see the line "GiveIt: Permissions support enabled" in the console ??
    If that line isn't showing then it's not detecting the Permissions plugin.
     
  21. Offline

    Phase

    It worked after the server was restarted, but unless I'm misunderstanding the allowed.txt format, then only 1 stack can be spawned at a time (64), even if that item has a higher value (currently 192 on most of the items)
     
  22. Offline

    vsTerminus

    Hi there, I like your plugin but I have three suggestions for you:

    1) Allow the command to be used without padding to 3 digits (example, /giveme 1 50)

    2) Allow the command to give more than 99 of any item (example, /giveme 1 1024)

    3) Most item mods also allow you to specify a name instead of the item ID. This would be nice as well. (example, /giveme stone 512)

    Thanks :)
     
  23. Offline

    cian1500ww

    1 and 2 will be implement in version 1.2

    I'll look into point number 3

    Thanks for the suggestions :)
     
  24. Offline

    cian1500ww

    Just posting an update to let you know that I'm still working on 1.2 and I hope to have it ready by early next week. It'll be supporting CraftBukkit builds 400+.
     
  25. Offline

    Jandalf

    yeah i want this plugin, waiting for 454+ support, cause of the new onCommand event.
     
  26. Offline

    cian1500ww

    New version should be out later today :)
    --- merged: Mar 1, 2011 11:07 PM ---
    Updated to Version 1.2, download link is in the original post along with additional instructions. Let me know of any problems!!
     
  27. Offline

    Jandalf

    ok, great plugin:) one request:
    could u add a timer function so that the amount will reset itself after a specific period? for example that one player could use 30dirt every day? and the time should be counted in running server time or online time of that player...
     
  28. Offline

    cian1500ww

    Leave it with me and I'll see what I can do :D
     
  29. Offline

    Jandalf

    k, thanks:)
     
  30. Offline

    Nate204

    Is this plugin supported with the latest recommended build? I think it's 492? or around there.
     

Share This Page