A simple shop using the chat line. This allows you to have a shop for players to use Uconomy currency to buy items and vehicles. Buying vehicles is turned off by default.
There are 3 commands: /shop, /cost, /buy, and /sell.
/cost, /buy, and /sell are meant to be used by everyone that has permissions for them. Just put the command in the permissions file for the group.
/shop is meant for admins only, but is not limited to that. You can add groups to have the ability to use this command by adding shop in their group of commands and one or more of the following: shop.add (adding to the shop), shop.rem (removing from the shop), shop.chng (changing costs), shop.buy (buyback costs), or shop.* (all 4) to the group permissions.
/buy [v.]<item name or id>/[amount] – This will use the same name to id find as /i. Use v for vehicles. Amount is only available for items and is optional, default is 1.
/cost [v.]<item name or id> – Same as above but will display the user the cost of asked for item/vehicle as well as the sell cost if there is one (sell cost for magazines and ammunition boxes is for full capacity not individual bullets).
/sell <item name or id>/[amount] – This will allow you to sell items (no vehicles) back to the shop. If QualityCounts is set to true, the quality of the item will determine how much of the price is received. If buyback is 1.00 and quality is 45%, you’ll receive 0.45 for example. For magazines and ammunition boxes, it will buy back individual bullets. Quality isn’t used here as there is none. So if you want to sell a full military ammo box of 40, you’ll do /sell military ammunition/40.
/shop <add/rem/chng/buy>/[v.]<itemid>/<cost> – This is the most complicated as it has multiple options. add (Adding), rem (Removing), chng (Change cost), buy (Buyback amount), v is needed if dealing with vehicles. Itemids only (no names) for this command and one is required. Cost is not required for rem, but is required for the others. You do have to add the buyback amount separately from the add or chng.
Only /shop can be run from both the console and in game.
This will run off the same database as Uconomy, but just create 2 new tables for the items and vehicles in the shop to be stored in. The tables are created blank. An admin, or someone with ability to use /shop, will have to add the items/vehicles. These can only be added one at a time through the command. If you can access the table with something like phpmyadmin, feel free to add them in mass that way.
Costs cannot be lower than 0.01. You cannot create any “free” items. Anything at 0.00 or less will trigger the not available message.
With the 188.8.131.52 update, there was a new column added to the table for the item shop. It should automatically create it though please let me know if you encounter an error. A lot more added to the configuration file too so please update or you’ll get errors.
With the 184.108.40.206 update, the config file was drastically changed. Please backup your info, delete or rename the file, and let the plugin recreate it. You can also use the defaults given above.
Are you tired of adding each item with commands to the shop? Look at the UUU to be able to add multiple items directly to your database.