[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

    cian1500ww

    It's only designed to take usernames in the allowed.txt file, that's why you're getting an exception when you try to use the plugin. It's getting confused because of the format of 001.
     
  3. Offline

    Randy Schouten

    Is it going to be updated to use groups sometime?
     
  4. Offline

    cian1500ww

    I'm not sure tbh, I'll look into it and see if it would require much.
     
  5. Offline

    Hudson Diesing

    haha, I was just going to ask to add group support! That would be so awesome! I love using this plugin with my default builder rank but would like donator/trusted players to spawn moar items, give me group support! XD
     
  6. thank you lol btw i added the other ones... works awsome. off topic why dont bukkit have any pluggins that add blocks? or that have furnature and things. i found a realy awsome airplane mod with biwings but its only for the RAW server .... wich fails when we use
     
  7. Offline

    Phase

    Mods that add new items/blocks/mobs/other similar stuff require both a modification to the server, and a modification to every client that connects to that server.

    At the moment, that is an unreasonable request to make, in my opinion. I would most definitely NOT play on a server that required installing a client mod.

    Anyway, we're getting off of the topic of the original thread. There's a post floating around somewhere from a guy who is working on a client/server mod that would allow pretty much what you're asking, but until Mojang specifically allows this sort of behavior in the official client, I don't see it being at all popular.

    @cian1500ww GiveIt appears to be working perfectly for me on 677 :)
     
  8. Offline

    cian1500ww

    Ok, I'll implement group support in the next update, I'll probably have it ready for when Bukkit is updated for Minecraft 1.5
    @Phase Thanks for that, I'll update the thread :D
     
  9. Well it is quite popular in the origional server just not bukkit i love bukkit but furnature or sdk guns or planes would be nice my server is plrity much just for archetech building but some fun with new items on other worlds would be nice. i have ran the server.jar from minecraft with these mods by its self but it is wayy to laggy and its not stable (so maybe its all on the way)
     
  10. Offline

    ZachBora

    Can you make a change to allow specific items for specific groups instead of specific players?

    Also, it appears im forced to put 001=128 even if you wrote it was fixed :(

    Edit: Can you sort the /givemeinfo ? I have them in order in the file but it comes out all mixed.
     
  11. Offline

    cian1500ww

    I'll see what I can do with groups.

    The item codes need to be 3 digits for the allowed.txt file, it's only the ingame commands that don't.

    Should be able to sort /givemeinfo in the next update.

    I also hope to add support for spawning items with the name as an alternative to the item code. All of this should be done in the next 1-2 weeks.
     
  12. Offline

    Phase

    @cian1500ww This works for me on the newest recommended build 733.
     
  13. Offline

    cian1500ww

    @Phase Thanks for the heads up!!
     
  14. Offline

    Phase

    Anytime! Thanks for the plugin :)

    @cian1500ww Would you mind a quick feature suggestion? We're having issues with people spawning negative durability items to essentially become invulnerable. Could you make a config option to disable the ability to spawn negative value items, or perhaps a permission node that would allow you TO spawn it? Thanks again
     
  15. Offline

    Po1ntBlank

    Please help, whenever I (op) or anyone tries to spawn anything, it says sorry, it is not possible to spawn that item. I am op, and they all have access to giveit.allow. all other plugins work! (including multiverse, which disables if permissions is messed up) Please help!

    My allowed.txt says:

    Code:
    #ItemID=Amount.username
    1=128
    3=128
    4=128
    5=128
    6=128
    7=128
    12=128
    13=128
    17=128
    20=128
    24=128
    35=128
    44=128
    45=128
    47=128
    48=128
    49=128
    50=128
    54=128
    82=128
    87=128
    88=128
    89=128
    64=1
    63=1
    69=1
    70=1
    71=1
    72=1
    75=1
    77=1
    26=1
    265=128
    256=1
    257=1
    258=1
    267=1
    268=1
    269=1
    270=1
    271=1
    273=1
    274=1
    275=1
    277=1
    278=1
    279=1
    284=1
    285=1
    286=1
    290=1
    291=1
    292=1
    293=1
    294=1
    319=1
    320=1
    321=1
    323=1
    324=1
    325=1
    328=1
    330=1
    333=1
    345=1
    346=1
    347=1
    352=1
    355=1
    357=1
    2256=1
    2257=1
    
    
    All other text files are blank
     
  16. Offline

    Freshbite

    I got lazy, and made a program that created the "allowed.txt" for me.
    It's actually an extended version, as it does not require you to update it between patches, it holds all the ID's up to 9999, so it might take a while before Notch fills up the ones that are available. The maximum value you can spawn of an ID is also 9999. The maximum value your inventory can contain is actually 2304, but I figured it would be quite easier to just spam '9' to fill the inventory, the spill disappears anyway, it's not dropped.

    Anyway, here's the "Allowed.txt" file for those who have use of it.
    OP, you might consider adding a filled "allowed.txt" of your own so that people won't have to look for it, most people who uses this plugin installed it because it's much more convenient to type;

    "/giveme 1 9999", rather than

    "/give Freshbite 1 64"
    "/give Freshbite 1 64"
    "/give Freshbite 1 64"
    "/give Freshbite 1 64"
    "/give Freshbite 1 64"
    "/give Freshbite 1 64"
    ... and so on.

    Atleast that's my reason.
     

    Attached Files:

  17. Offline

    NemTheking

    Can anyone recommend any plugins that allow certain op features but not others? because i'd like to have my OPs able to set the time, use other plugin commands, teleport etc. but replace the /give command with this. Any help?
     
  18. Offline

    eriorkless

    Does this support different colored dyes, logs, etc?
    Great plugin by the way! :)
     
  19. Offline

    Nazerb

    could you add support for custom names?
     
  20. Offline

    Cookieee

    Hi, I'm currently getting plugins lined up for a server I am setting up, and this can prove to be very useful to what I want to do with the server. However, is there a way to limit the amount of blocks a user can spawn through this command in any given time frame, for example, a day? This would be very useful to me, thanks!
     
  21. Offline

    TD0615VFX

    is there a way to make all items allowed? because i wanted to get this plugin mainly so i could use the give command without typing my whole name but when i try to spawn anything it says it isnt possible to so im assuming i have to allow it for every item and i would rather not do that
     
  22. Offline

    Phase

    @cian1500ww Please update GiveIt to the latest RB 818! Thanks :)

    You have to allow every item at the moment.
     
  23. Offline

    TD0615VFX

    oh dang :p o well i did anyway

    BTW it would also really nice if when spawning an item say stone to spawn only 1 we could put /giveme 1 without havign to put the quantity of 1 :p just a little more convenient because i am and im sure others are to are used to doing that with the give command but whatever

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  24. Offline

    Lil_Lyon

    I'm using this with permissions 3.1 and Bukkit build 818.
    Are there any known issues?
     
  25. Offline

    cian1500ww

    I will update this plugin this weekend
     
  26. Offline

    jubjub449

    If I may suggest a feature:

    Economy support, perhaps allowing a different cost for each type of item/block?
     
  27. Offline

    Hudson Diesing

    Update? =] I love using this plugin on my server, would appreciate it working again =]
     
  28. Offline

    cian1500ww

    Could people post the console output that is displayed when the plugin stops working??
     
  29. Offline

    cherrykid13

  30. Offline

    cian1500ww

    Thanks, I'll get working on that ASAP.

    I've tested it with 818 and it works fine, are people still having problems?? That exception was caused by an incorrect command or an ID not in a 3 digit format in the allowed.txt file.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 8, 2016
  31. Offline

    cian1500ww

    I can't find any issues with this plugin with CB build 818 so I'm going to mark it as compatible.
     

Share This Page