PaidSwitch
PaidSwitch
Make your players pay other players for using their switches.
Features:
- Supported switches: pressure plates (wood and stone), stone button, lever, detector rail.
- Vehicle support (vehicle with passanger on pressure plate)
- Sign-based switch setup.
- Separate permission for each switch type.
- Price limits
- Config options to decide what types of switches should PaidSwitch work with.
- Economy support: all economy plugins supported by Vault.
- Permission support: all SuperPerms-compatible permission plugins (tell me if you want support for older permission plugins)
- PluginReloader compatible.
This plugin REQUIRES Vault
Usage:
To make your switch paid, put a sign next to the switch, and fill it with pattern below:
Line 1: [PaidSw]
Line 2: player account / b: bank account / leave blank / none
Line 3: cost
Line 4: description (optional, shown in notifications)
If there's more than one sign next to switch, first sign found will be used (searching order: UP, NORTH, EAST, SOUTH, WEST, DOWN)
If line 2 is empty, your name will be put there automatically.
You can also specify name of other player or economy account in line 2 if you have paidswitch.create.others permission. "none" is default name for void account, it means if you put "none" in line 2, money goes to nowhere. Could be useful if your economy doesn't support accounts.
Accounts:
You should use accounts, if you don't want any player to get the money from specific switch.
If you use iConomy, you can create account by /money create <account_name> and put it on the line 2.
If you use BOSEconomy, you can create account by /econ bank create <account_name> and put it on the line 2 with "b:" prefix.
There should be NO SPACE after "b:"
Commands:
/paidswitch - display info about plugin /paidswitch reload - reload config.yml aliases: /paidsw, /psw
Permissions:
paidswitch.*: description: Gives all PaidSwitch permissions excepting free use. children: paidswitch.use: true paidswitch.create: true paidswitch.create.others: true paidswitch.create.duplicate: true paidswitch.create.type.*: paidswitch.use: description: Allows to use PaidSwitches. default: true paidswitch.use.free: description: Allows to use PaidSwitches for free. default: false children: paidswitch.use: true paidswitch.create: description: Allows to create PaidSwitches. default: op paidswitch.create.others: description: Allows to create PaidSwitches for someone else. default: op paidswitch.create.duplicate: description: Allows to create a second sign for other players' PaidSwitches. default: op paidswitch.create.type.*: description: Allows to crate all types of PaidSwitches. default: op children: paidswitch.create.type.wood-plate: true paidswitch.create.type.stone-plate: true paidswitch.create.type.button: true paidswitch.create.type.lever: true paidswitch.create.type.detector-rail: true paidswitch.create.type.wood-plate: description: Allows to crate paid wood plate. default: op paidswitch.create.type.stone-plate: description: Allows to crate paid stone plate. default: op paidswitch.create.type.button: description: Allows to crate paid button. default: op paidswitch.create.type.lever: description: Allows to crate paid lever. default: op paidswitch.create.type.detector-rail: description: Allows to crate paid detector rail. default: op paidswitch.limit.price.none: description: Allows to create PaidSwitches with unlimited price. default: op paidswitch.limit.price.limit1: description: "Sets user's price limit to limit1 from config." default: false paidswitch.admin: description: Gives access to /paidswitch command. default: op
Configuration:
earn-for-free: false # should switch owner earn money, when switch user has paidswitch.use.free permission? switch-type-permission-needed: true # does player need paidswitch.create.type... permission for creating each type of switch? allowed-switches: # enable/disable PaidSwitch for specific switch types (both creating and using, if you disable a type, paidswitches of this type created before will become free of charge) wood-plate: true stone-plate: true button: true lever: true detector-rail: true vehicle-support: true # enable/disable treating vehicle with passenger on a pressure plate like the passenger on the pressure plate. notify-owner: true # should switch owner be notified when someone uses his switch and pays for it? notify-owner-free: true # should switch owner be notified when someone uses his switch for free (paidswitch,use.free permission) limits: # limits section, described below price: default: 0 messages: (...) # you can translate them if you want. Remember to use /n (not \n) for new line and repeat colorcodes after each newline mark. log-level: INFO # set logging level, change only for debug purposes. In other cases, this should be INFO.
Limits:
Limits are configured in limits section in the config. For now, there are only price limits. More types of limits might be added in the future.
Price Limits:
Price limits are configured in price subsection of limits section in the config, They set the max price player can put on the PaidSwitch sign.
To add limit, simply add a config entry in the format limit_name: price .
Then give permission node paidswitch.limit.price.limit_name to the player or group, which should be limit applied to.
Limit priority is based on its position in config. The higher a limit is placed in config , the higher priority it has.
If a player has no limit permissions, or the limit he has permission to doesn't exist, limit called 'default' is applied.
You should never give a player paidswitch.limit.price.default permission.
Zero price in limit entry means no limit. You can also give a player paidswitch.limit.price.none permission. Note that this permission has the highest priority.
Example limit section:
limits: price: default: 10 my_cool_staff: 0 limit2: 55 limit1: 50 thrusted-members: 20 guest: 5
Actually deafult should be the last limit in the config, but for some reason it always goes to the top when config is reloaded.
Note that limits are checked only when a PaidSwitch is created, but not when somone uses it. If a player makes a switch that costs 100, and then you set the limit to 50, players who use that switch will still pay 100.
Known Bugs:
LWC BugAccounts don't work with BOSEconomy- Sometimes paid pressure plate is activated multiple times, when there are lot of entities on it.
"b:" before account name causes crashes if economy doesn't support banks.Can't activate Paidswitches by clicking them while sitting in vehicle.(v0.4 only)- Vehicle support doesn't work with stone pressure plates.
Found a bug? Report it here.
Don't like Github Issue Tracker? I can switch to standard BukkitDev ticket system, just let me know.
Planned Features:
Detector Rail support.(done)Colored messages.(done)- Paid Doors.
Permission and config node for each switch type.(done)Price limits.(done)Notification for switch owner when someone uses his switch.(done)- LWC integration (softdepend)
- Waiting for your suggestions.
works very nicely with 1.5.2. thanks for nice plugin.
@Flenix1
When I was designing this plugin I was very careful to make it impossible to hide the sign :P If you put the sign behind the block the button is placed on, it won't work, cause it's 2 blocks away from the button.
@Jahb57
Towns have their own bank accounts, use those ;)
It's something like town-TOWNNAME
Does this work if the sign is on the back of the button block? I'd like the signs hidden so I can put a custom sign by it, like "Door Charge: 10 Coins" or something.
Maybe add towny support so they can do something like t:Summerlake ? i
@Hoelder
Unfortunately, I didn't have enough time to maintain this plugin. Have you checked if it still works with latest CB releases? If it doesn't, please post some log or write what doesn't work. I might find some time to fix that, but I don't promise anything.
Is this plugin still alive?
It sounds cool, but it needs to be up to date all the time, if I want to use it on my public server.
@bluewolf279
Isn't it true that Towny doesn't have its own economy plugin, it just supports all existing economy plugins?
can you make it pay a towny advanced bank
@BlockTilt
Actually, I do have something like that, but that's rather debug info.
Just set the log level to FINE (You could also try FINER, but I think that's too much). If Bukkit blocks that output, you will need http://dev.bukkit.org/server-mods/logger-manager/LoggerManager aswell.
Tell me if this logging is enough for you. If it's too much or too little, I'll try to setup something else.
Could you add logging to console? I parse my log files for stats, for example with ChestShop. It would be nice to comb through for PaidSw stats too.
if it can output [PaidSw], the amount, the coordinates of the switch, and the owner of the switch that would be great.
@bukOhTwo
The issue was already discussed somewhere in the comments. Using signs has 2 advantages:
Any chance to allow this to not require a sign? I just don't like the look of a sign next to the button/lever. :(
@hovedhakker
You can use GoldIsMoney with custom currencies as economy plugin. The effect should be what you want, but I haven't tested it.
Could you make it so that it could charge you items instead?
Wow, 2k downloads, thank you everyone who enjoy my plugin. I promise I'll make it even better and safe to use on big servers. Stay tuned.
@BlockTilt
Done!
@Wolf480pl
just while they're online is fine.
I was also thinking of tripwire support (disabled by default), but the problem is: where do you put the sign? On the wire? On which block of wire? On every? Or maybe on the hook (which is hidden behind the corner) ? Useful for traps, but PaidSwitch is not for traps...
I could add tripwire support as a trap feature for trap-friendly and thieves-friendly servers (disabled by default). What do you think about it?
@BlockTilt
Good idea. If switch owner is offline, should announcements wait for him, and appear when he joins the server?
Announcing to the owner of the switch when it's used would be nice. ChestShop does this and it's useful to know when you get money.