[RPG/MECH] Turnstile v1.9.1 - Charge players money/items to enter an area [953]

Discussion in 'Inactive/Unsupported Plugins' started by Codisimus, Mar 15, 2011.

  1. Offline

    Codisimus

    This page will no longer be updated. Please follow this project at the Bukkit Dev Page

    Turnstile - Charge players money/items to enter an area:
    Version: 1.9.1 (7/16/2011)
    Supports iConomy, BOSEconomy, Essentials, Permissions
    Download Page

    This plugin is used to create a Turnstile to prevent players from entering certain locations without paying money/items.

    The Turnstile is made up of a fence block, this block will disappear when a linked button is clicked. The block will reappear when walked through or after a certain amount of time. Money is deducted from the user when they press the button (or walk through the Turnstile if 'NoFraud' is set to true in the config). All money deducted is given to the owner/bank of the Turnstile.

    Turnstiles can also charge items by linking a chest instead of a button. Put the required item in and punch the chest to open the Turnstile.

    Format of Save file:
    Show Spoiler

    Code:
    DreknorIn;1;4;13;2;scudmaster;Codys_World;-174;55;-102;
    -175:55:-101;-174:55:-99;
    
    [Name];[Price];[Earned];[ItemID.Damage Value];[Amount of item];[Owner];[WorldName][x];[y];[z](of location of Turnstile);
    [x];[y];[z](of location of linked button/chest);[x];[y];[z] (of location of linked button/chest);

    Features:
    • Configurable properties.
    • Custom messages
    • No Fraud mode (Turnstile doesn't charge until walked through)
    • Restrict use of a specific Turnstile to a certain group
    • Make a Turnstile Free or Locked during a certain time of day
    • Autoclose timer
    • Create private Turnstiles only you can use
    • Only owners and admins can destroy Turnstile blocks, buttons, and chests
    • Edit turnstiles easily in game or in the save file
    • Only the owner/bank owner can edit a turnstile
    • Turnstiles can charge specific items instead of money
    • Durability support
    • Turnstiles can also be free to use
    • Charge users money to create turnstiles
    • Set different Turnstiles to unique prices and owners/banks
    • List and locate Turnstiles
    • MultiWorld support
    • Uses iConomy, BOSEconomy or Essentials to charge users money
    • Permissions to limit players from using turnstiles, for all commands (except help), and for admins
    • Included in CraftBukkitUpToDate for easy updating (make sure you come check the changelog if somthing is not working right)
    Commands:
    Commands can be written as /turnstile or /ts
    Show Spoiler

    • /ts make [Name] - Make target fence block into a Turnstile
    • /ts link [Name] - Link target block with Turnstile
    • /ts rename [Name] [NewName] - Renames the Turnstile
    • /ts unlink [Name] - Unlink target block with Turnstile
    • /ts delete [Name] - Delete Turnstile and unlink blocks
    • /ts price [Name] [Price] - Set cost of Turnstile
    • /ts price [Name] [ItemID(.Damage)] [Amount] - Set cost to item
    • /ts access [Name] public - Allow anyone to open the Turnstile
    • /ts access [Name] private - Allow only the owner to open
    • /ts access [Name] [Group] - Allow only specific Group to open
    • /ts free [Name] [TimeStart-TimeEnd] - Free during timespan
    • /ts locked [Name] [TimeStart-TimeEnd] - Locked during timespan
    • /ts earned [Name] - Display money the Turnstile earned
    • /ts collect - Retrieve items from the target Turnstile chest
    • /ts owner [Name] [Player] - Send money for Turnstile to Player
    • /ts bank [Name] [Player] - Send money for Turnstile to Bank
    • /ts list - List all Turnstiles
    • /ts info - Gives info of Turnstile
    • /ts help - Displays Turnstile help page

    Permission Nodes:
    Show Spoiler

    • turnstile.open - Needed to be able to activate Turnstiles
    • turnstile.openfree - Player/Group is not charged to open Turnstiles
    • turnstile.make - Needed to make/link/unlink/delete Turnstiles
    • turnstile.makefree - Player/Group is not charged to make Turnstiles
    • turnstile.set.free - Allows Player/Group to use /ts free
    • turnstile.set.locked - Allows Player/Group to use /ts locked
    • turnstile.set.price - Allows Player/Group to use /ts price
    • turnstile.set.owner - Allows Player/Group to use /ts owner
    • turnstile.set.access - Allows Player/Group to use /ts access
    • turnstile.set.bank - Allows Player/Group to use /ts bank
    • turnstile.earned - Allows Player/Group to use /ts earned
    • turnstile.admin.list - Allows Player/Group to use /ts list
    • turnstile.admin.info - Allows Player/Group to use /ts info
    • turnstile.admin.ignoreowner - Player/Group can edit any Turnstile regardless of being the owner

    Tutorial:
    NOTE: New Tutorial video, Please watch before asking questions.




    ToDo:
    • Send items to owner
    • Add option of using a door instead of a fence block
    • Add pressure plate support
    Changelog:
    Old Versions + ChangeLog can be found at Download Page
    Show Spoiler

    Version 1.9.1 (7/16/2011)
    • Added rename command
    • Now allows multiple Turnstiles per block
    • Fixed Access
    • Added color support for all customizable messages
    Version 1.9 (6/26/2011)
    • Improved OP options
    • Updated Economy support
    • Fixed collect command
    • Added option of door instead of block
    • Added pressure plate support
    Version 1.8 (6/12/2011)
    • Cleaned up code/fixed errors
    • Added /ts collect command to retrieve earned items
    Version 1.7.6 (6/4/2011)
    • Cleaned up errors and added error messages
    Version 1.7.5 (6/3/2011)
    • Various fixes and code cleanup
    Version 1.7.4 (6/3/2011)
    • Added Essentials econ support
    Version 1.7.3 (5/20/2011)
    • Fixed durability support
    Version 1.7.2 (5/20/2011)
    • Added decimal support
    Version 1.7.1 (5/16/2011)
    • Readded the useOpenFreeNode and useMakeFreeNode options in config
    Version 1.7 (5/15/2011)
    • Changed permission nodes
    • Allow right clicking a button to open
    • Made Turnstiles unbreakable
    • Added command to allow group specific Turnstiles
    Version 1.6.1 (5/4/2011)
    • Updated to iConomy 5
    • Few various fixes
    Version 1.6 (4/29/2011)
    • Added durability support
    • Added custom messages
    • Fixed reload issues
    • Added No Fraud mode (Turnstile charges when walked through)
    • Added option to restrict use of a specific Turnstile to a certain group
    • Added option of making a Turnstile Free or Locked during a certain time of day
    • Added autoclose timer
    Version 1.5 (4/15/2011)
    • Improved multiworld support
    • Other various fixes
    Version 1.4.3 (4/4/2011)
    • Fixed isOp() conflicting with Permissions
    Version 1.4.2 (3/31/2011)
    • Few minor fixes
    • Works with build #612
    Version 1.4.1 (3/30/2011)
    • Can now use with left or right hand
    Version 1.4 (3/30/2011)
    • Fixed turnstile creation
    Version 1.3.3 (3/30/2011)
    • Updated to build #602
    • Changed the way you create turnstiles. Now you must target the fence block that will become a Turnstile
    Version 1.3.2 (3/28/2011)
    • Added private Turnstiles, Set price to -808 to make it so only the owner can enter
    Version 1.3.1 (3/28/2011)
    • Fixed error of crashing if owners name is < 5 letters long
    Version 1.3 (3/26/2011)
    • Added protection for Turnstile blocks, buttons, and chests
    Version 1.2.1 (3/24/2011)
    • Various fixes
    Version 1.2 (3/23/2011)
    • Fixed multiworld support
    Version 1.1 (3/23/2011)
    • Fixed paying with items not opening Turnstile
    Version 1.0 (3/23/2011)
    • Added an autoclose timer (set to -1 as default in config file meaning it will stay open until walked through)
    • Added '/ts earned [Name]' command (no permission node)
    • Fixed config
    • Added option of setting price to all (saved as -411 in save file) which will clear a players balance as the cost
    • Fixed error of turnstile opening without enough money
    • Fixed permissions reload
    • Fixed/added lots of other things I can't even remember
    Version 0.9 (3/22/2011)
    • Fixed error of no confirmation messages for iConomy
    • Added a check to make sure the balance has enough money
    • Implemented option of paying with a specific item
    • Added config file with the following options
      • CostToMakeTurnstile=0
      • useIgnorePriceNode=False
      • useIgnoreCostNode=False
    Version 0.8.3 (3/19/2011)
    • Fixed unknown command spamming chat
    • Fixed no Economy message spamming
    • Changed /ts locate to /ts info (turnstile.admin.info)
    Version 0.8.2 (3/19/2011)
    • Added multiworld support (you must rename save files to Turnstile[WorldName].save or turnstiles will not be loaded)
    Version 0.8.1 (3/18/2011)
    • Fixed /ts bank not working
    • Added /ts bank to help page
    • /ts bank now only works with BOSEconomy linked
    Version 0.8 (3/18/2011)
    • Added support for BOSEconomy banks
    • New node turnstile.admin.bank
    • New command /ts bank [Name] [Bank]
    Version 0.7.1 (3/17/2011)
    • Mispelled commands display help screen
    • If owner is set to "server" then money is not added or deducted from the owner
    • Button now only works when turnstile is closed
    Version 0.7 (3/17/2011)
    • Turnstile now closes after being walked through
    • Fixed error of "Turnstile successfully loaded with Permissions!" being displayed multiple times
    Version 0.6.1 (3/16/2011)
    • Fixed error that Permissions was required
    Version 0.6 (3/16/2011)
    • Added support for Permissions
    Version 0.5 (3/16/2011)
    Version 0.4 (3/15/2011)
    • Limited commands to the owner of the turnstile
    • Other various fixes
    Version 0.3 (3/15/2011)
    • Initial Release
     
  2. Offline

    Shenlong

    Thank you :).
     
  3. Offline

    Codisimus

    they are now part of CraftBukkitUpToDate I will also post this in the descriptions too

    Seems adjusting my code to allow this in a config file is a little more than I expected. I'm just wondering why you want this option. It will always load BOSEconomy fine unless you also have iConomy running on your server for some reason.

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

    riuthamus

    Well if thats how it works, thats good, i wasnt sure how you were switching it on and off... so no needed. Thanks though!
     
  5. Offline

    Codisimus

    it looks for iConomy and links to it and if it isnt there then it looks for BOSEconomy and links to that. if niether are there then it will just through a bunch of errors when trying to charge accounts lol.
    when it loads an Economy system it also sets a flag which is checked whenever a transaction is made so it knows which Economy system is linked
     
  6. Offline

    riuthamus

    This is how we are using the system, and we love it!!

     
  7. Offline

    Codisimus

    *Quoted in original post
     
  8. Offline

    Kenshin

    Hello, i have a problem with your great plugin !
    The plugins decount 30 money but if the player have no money i can pass :O

    How can i fix that ?
    Thanks ?
     
  9. Offline

    Codisimus

    Some economy systems allow for having a negative balance, I will fix this tonight.
     
  10. Offline

    Travis_Hironak

    Is there a way for admins to pay when they use a turnstile ? Because admins have all permissions, therefore they have turnstile.admin.ignore.price. Can you add an option to make them pay in your config file when you'll make it please?
    Thanks in advance.
     
  11. Offline

    Codisimus

    yes i am making this as we speak... that node will be toggled off by default
     
  12. Offline

    Travis_Hironak

    Ok, thanks :D.
     
  13. Offline

    Codisimus

    I am looking for additional settings to put in the config file. Any suggestions are welcome
     
  14. Offline

    Travis_Hironak

    Maybe configurable messages when you use a turnstile to inform you how much you spent and how much money remains in your balance.
     
  15. Offline

    Codisimus

    Great thanks! (I feel dumb releasing config support with only two or three options lol)
     
  16. Offline

    SunShe

    lol i havent read previous messages but, an idea has crossed my mind. Have you thinked to a "Month subscription card" like real life ? xD
    You paid a "Month subscription card" and then can for next 30 days or if "week card" next 7 days can use transport (Turnstiles) for free ? :rolleyes:
     
  17. Offline

    Moe041991

    i dont really get any errors. but i dont get a message that i paid for the turnstile... :(.
    Newest reccomended CB, Newest Iconomy, newest permissions.
     
  18. Offline

    Kenshin

    For the negative money:
    I have Iconomy with Mysql
    Can you quote me when you have done plz (for the alert :p)

    Thanks a lot !
     
  19. Offline

    Codisimus

    This is a good idea but different turnstiles send money to different ppl/banks so im not sure how well this would work.
    First of all if you have the permission node turnstile.admin.ignore.price then you wont be charged for using turnstiles. Otherwise check you balance b4 and after, does it change at all?
    Yes I will quote you.it should be within 12 hours.
     
  20. Offline

    Moe041991

    Yes it does. It also tells the other players, so its not really an issue. Thanks for your support :).
     
  21. Offline

    Codisimus

    ill check my code to see why confirmation messages aren't popping up
     
  22. Offline

    HungryBagel

    Absolutely love it, nice work.
     
  23. Offline

    Codisimus

    Version 0.9 (3/22/2011)

    • Fixed error of no confirmation messages for iConomy
    • Added a check to make sure the balance has enough money
    • Implemented option of paying with a specific item
    • Added config file with the following options
      • CostToMakeTurnstile=0
      • useIgnorePriceNode=False
      • useIgnoreCostNode=False


    kinda a sloppy release, proly has sum errors but i wanted to get it out, hopefully im not so busy later in the week

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

    Moe041991

    Hey Codisimus!

    Thank you for you great PlugIn! This is really a lot of us have been looking for!
    I have some suggestions! Whenever you use a turnstile and dont walk thru it, it will stay open until somebody is walking thru it. Is it possible to make the turnstile in a way, that it will close itself again after a certain time?

    I also have sometimes some minor error in console. But it still works great!
    Sorry for my bad english!
     
  25. Offline

    Travis_Hironak

    I updated to turnstile 0.9, put the config.properties in \plugins\Turnstile and made some tests on my server (cb556):

    - I still don't pay when I use a turnstile with useIgnorePriceNode=False in the config file. Therefore I have no confirmation message.
    - Then I set the price to 2 Obsidian Blocks (/ts price test_1 49 2), but when I use the turnstile I have the following message in the console and the turnstile remains open even if I walk by it several times (with 10 obsidian blocks in my hotbar).
    Error message (open)
    2011-03-22 11:05:44 [SEVERE] Exception in thread "Thread-12"
    2011-03-22 11:05:44 [SEVERE] java.lang.NullPointerException
    2011-03-22 11:05:44 [SEVERE] at java.util.LinkedList.remove(Unknown Source)
    2011-03-22 11:05:44 [SEVERE] at java.util.LinkedList.removeLast(Unknown Source)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.util.SoftMap.fastGet(SoftMap.java:110)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.util.SoftMap.get(SoftMap.java:98)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.CraftChunk.getBlock(CraftChunk.java:64)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.CraftWorld.getBlockAt(CraftWorld.java:57)
    2011-03-22 11:05:44 [SEVERE] at net.minecraft.server.World.k(World.java:366)
    2011-03-22 11:05:44 [SEVERE] at net.minecraft.server.World.h(World.java:350)
    2011-03-22 11:05:44 [SEVERE] at net.minecraft.server.World.f(World.java:323)
    2011-03-22 11:05:44 [SEVERE] at net.minecraft.server.World.e(World.java:295)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:127)
    2011-03-22 11:05:44 [SEVERE] at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:117)
    2011-03-22 11:05:44 [SEVERE] at turnstile.Turnstile$1.run(Turnstile.java:109)

    -Then if I set the price back to 10 coins (/ts price test_1 10), the turnstile works again but I still don't pay when I use it.

    Thanks in advance :).
     
  26. Offline

    Moe041991

    Now i do have a mayor Problem. 0.9 didnt fix that as well.

    Code:
    java.lang.NullPointerException
    	at java.util.LinkedList.remove(Unknown Source)
    	at java.util.LinkedList.removeLast(Unknown Source)
    	at org.bukkit.craftbukkit.util.SoftMap.fastGet(SoftMap.java:110)
    	at org.bukkit.craftbukkit.util.SoftMap.get(SoftMap.java:98)
    	at org.bukkit.craftbukkit.CraftChunk.getBlock(CraftChunk.java:57)
    	at org.bukkit.craftbukkit.CraftWorld.getBlockAt(CraftWorld.java:56)
    	at org.bukkit.craftbukkit.CraftWorld.getBlockAt(CraftWorld.java:420)
    	at org.bukkit.Location.getBlock(Location.java:73)
    	at turnstile.TurnstilePlayerListener.onPlayerMove(TurnstilePlayerListener.java:266)
    	at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:192)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:124)
    	at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    	at net.minecraft.server.NetworkManager.a(SourceFile:230)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    2011-03-22 11:46:08 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
    	at java.util.LinkedList.remove(Unknown Source)
    	at java.util.LinkedList.removeLast(Unknown Source)
    	at org.bukkit.craftbukkit.util.SoftMap.fastGet(SoftMap.java:110)
    	at org.bukkit.craftbukkit.util.SoftMap.get(SoftMap.java:98)
    	at org.bukkit.craftbukkit.CraftChunk.getBlock(CraftChunk.java:57)
    	at org.bukkit.craftbukkit.CraftWorld.getBlockAt(CraftWorld.java:56)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:333)
    	at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    	at net.minecraft.server.NetworkManager.a(SourceFile:230)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
     at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    I also get kicked now everytime i klick anything (Internal Server Error) until Server Restart.
    CB 531
     
  27. Offline

    Marco van Dijk



    I think i know what the problem is, as i am having exactly the same problem;
    Because i don't want to add all the permissions there are to the admins group i amde in permissions, i just added the '*'. But that also adds the node 'turnstile.admin.ignore.price' to the admin group, which makes all turnstiles free of charge. this is actually the only problem that i have with the plugin. As i think its better to add such thing to the config file.
     
  28. Offline

    Novemberman

    great plugin a lot of fun ( i have too many rich players on my server :p )

    but one problem can u make it upsidown compatible,
    i wish to place it above a track so player must to pay to leave in the cart
     
  29. Offline

    dak393

    You could just place a block then put the turnstile on top of the block and remove the block. However in the way you mentioned it wouldn't prevent a player from exiting a cart, no block can, they would just exit into the fence hit thier head and probably suffocate or be forced out. What's wrong with placing them to the side? (you could still put them on the ceiling)
     
  30. Offline

    Codisimus

    post your error please
    I should have explained how paying with items works... you link a chest instead of a button and put the item in the chest and then punch the chest. I didnt test the ingorepricenode thing so ill do that today.
    wut happens to start this error?
    wut i am trying to do is add to the config file to make it so if that is set to false you will still have to pay even if you have *
    bc of a glitch i believe if you try to create it on the block right below you it make it one block too high, maybe use that until i fix it.
     
  31. Offline

    Marco van Dijk

    I have a question, is there a way that people can not get a negative amount of money? Because i used the turnstile plugin to make an entrance to a Nazi zombies spin-off. You are supposed to go in with 0 money, get money for killing mobs and use the money to buy armor or new swords. Everything works fine, except for the tunrstile part. I made it so that you pay 999999 money to open the turnstile, but when you open it you're money will go below zero.

    I'm also really glad to see the '*' thing added to the config file, atleast trying to.
     

Share This Page