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.
@MrLunchMoney
Glad to hear that. Hope you enjoy my plugin.
The problem was with GoldisMoney. I installed there new beta 2.0 version and it is working just fine.
The player is not creative.
I did not directly give the player goldismoney.use The player is able to use the /balance command and I do belive that permission is defaulted as true. I will add the goldismoney.use directly the player and see if that helps.
Thank you for your help. I Look forward to the results from your test.
@MrLunchMoney
It must be an issue with GoldIsMoney's modified Vault. The message you get appears only when eco.hasAccount(second_line_of_sign) returns false. I'll test it myself and if I manage to reproduce it, I'll report the issue on their... comments (as they don't have issue tracker :( )
EDIT: Does the player have goldismoney.use ? Is the player creative?
The player is not online when I create the sign.
@MrLunchMoney
Is the player online?
I should also mention this only happens when I create a sign for someone else. Otherwise when I creat a sign for myself it works just fine.
Im using GoldisMoney http://dev.bukkit.org/server-mods/goldismoney/ and the player account does exist. Thank you for your help.
@MrLunchMoney
What economy plugin do you use? Does player joesnuffy exist?
I get this error.
Account joesnuffy (player) does not exist! Sign unregistered.
Does anyone no what I might be doing wrong?
@Zwing87
Hmmm... I thought default message level is [INFO], and you don't get [FINE*] messages normally. These are just some debug messages. Will remove it as fast as possible.
@Wolf480pl
0.5.1 version
Get the consol message.
11:07 AM [FINER] [PaidSwitch] No good at UP 11:07 AM [FINER] [PaidSwitch] No good at NORTH 11:07 AM [FINER] [PaidSwitch] No good at EAST 11:07 AM [FINER] [PaidSwitch] No good at SOUTH 11:07 AM [FINER] [PaidSwitch] No good at WEST 11:07 AM [FINER] [PaidSwitch] No good at DOWN
What's this?
"b:" issue with economies that doesn't support banks is fixed in v0.5.1 which is already uploaded
@finamenon We solved this problem.
The problem was probably usage of 'b:' with iConomy, which doesn't support banks, or space between 'b:' and account name.
@Wolf480pl
I use those same versions of iCo and Bukkit. Other plugins I use that also affect economy, buttons, and permissions:
bPermissions, EssentialsAntiCheat,Vault, Towny, Essentials. I don't see any other plugins in my list that would affect money, permissions, signs, or buttons.
@finamenon
What version of iConomy 6 and CraftBukkit? What other plugins do you use?
I tried to reproduce this bug on latest iConomy 6.0.8b and CB1.2.5-R4.0 but they don't work together.
I attempted testing this plugin on my test server. Everytime I used a button hooked up to a PaidSwitch sign, the server would hang for about 10 seconds. I use iCo 6 and the newest version of Vault.
@lambik
Just give your default group deny for paidswitch.use permission node, and then give allow fot this permission to another group.
Eg. in PEX:
I agree with comment below but I have one enhancement idea or wish, call it how you want. Could you please make ability to allow only specific group to use the switch? Thanks