Skip to content

TrueMB/RentIt

Repository files navigation

RentIt - Shop and Hotel renting - Includes NPC Shop

grafik

Join my Discord to get the newest Versions and fast Support! Invite Links are down below.

Description:

This Plugin is made for Server owners that want on their server a little bit RPG feeling. You can create with this Plugin Custom Shop and Hotelroom Areas, that your Players can rent! Also it gots an own Permission System for the Shop/Hotelroom owners to make them work together with friends. The Shops containing the Shop Owner NPC there players can buy from.

It works with a completly customzible GUI. You can change everything in the config, since I am saving nearly everything in it.

Youtube Tutorial:

Tutorial

Important to know:

Since this is a new Shop System and doesnt quite work like others, there is some stuff that you should know.

Both:

  • This Plugins works with Categories. So you can set values and easily take them for multiple Areas. Also you can sort them in a category Menu. F.e. in the /freeshops or /freehotels command.

Shop:

  • You can remove Shop Buy/Sell Items in the Menu with Rightclick (Shopowner or Player with the buy / sell permission)
  • Players can place a chest in the Shop Area (or players with the build Permission). This Chest counts as a Storage. So if a Player wants to sell multiple Items, they can add the item to the Shop and fill the storage with more of the type. The Buyer will at first get the Items of the storage. If there is nothing left in the chest, it will then take the item out of the shop.
  • You also need a Chest Storage, if you want to buy Items from Sellers. Those Items will be stored in all chests in the Shop. Until there is no space left or the player got no money. You can prevent buying to much, with filling other items in the chest, that are not present in the shop. So there is no space manually.

Commands:

%time% = 7D, 7h, 7m (this is case sensitiv!)

RentIt Commands

/rentit reload - Reloads Config and SQL Connection.

Shop Commands

/shops - Shows all your owned Shops.
/freeshops - Shows all free Shops.
/shop help - Opens a Help Book
/shop createCat {categoryID} {Price} {Size} {Time} - Create a Category.
/shop deleteCat - Delete a Category.
/shop listCat - Lists all Categories.
/shop list - Lists all Shops.
/shop setarea {categoryID} - Set the selected Region to the Shop category.
/shop setnpc - Set or Change the Position of the Shop NPC.
/shop setprice {Price} - Change the Rent Price. (Changes the category Settings)
/shop setsize {Size} - Change the Shop Size. (Changes the category Settings)
/shop settime {Time} - Change the Rent Time. (Changes the category Settings)
/shop reset - Reset the Shop, so it can get a new Owner.
/shop delete - Delete the Shop completly.
/shop updateBackup - Creates a new Backup of the current Shop Area
/shop buy {shopId} - Rent a specific Shop.
/shop sellitem {Price} - Sell the Item in your Hand in the Shop.
/shop buyitem {Price} - Add the Item in your Hand to the Buy Shop.
/shop buyitem {Type} {Price} - Add the named Item to the Buy Shop.
/shop buyitem {Type} {Item Amount} {Price} - Add the named Item with the given amount to the Buy Shop.
/shop setpermission {Player} {Permission} {Value} - Set Permissions for Players (Shop admins only).
/shop permissions - All Shop Permissions.
/shop users - List all Players with Shop Permissions.
/shop noInfo - Get no Informations of Transactions.
/shop info - Get informations from the Shop you are standing in.
/shop info {ID} - Get informations of the Shop with the ID.
/shop door add {ID} - Add Doors to a Shop.
/shop door remove - Remove a door from a Shop.
/shop door open - Open the doors in your own Shop.
/shop door close - Close the doors in your own Shop.
/shop rollback - Opens a menu with the forgotten items of the Shop.
/shop rollback {target} - Admin Command to get the Targets lost Items or to check them.
/shop setAlias {alias} - Set a different Name for the Shop.
/shop setAliasCat {catAlias} - Set a different Name for the Category of the Shop you are standing in.
/shop resign - Ends your running Contract.

Hotelroom Commands

/hotels - Shows all your owned Hotelrooms.
/freehotels - Shows all free Hotelrooms.
/hotel help - Opens a Help Book.
/hotel createCat {categoryID} {Price} {Time} - Create a Category.
/hotel deleteCat - Delete a Category.
/hotel listCat - Lists all Categories.
/hotel list - Lists all Hotels.
/hotel setarea {categoryID} - Set the selected Region to the Hotelroom category.
/hotel setpermission {Player} {Permission} {Value} - Set Permissions for Players (Hotelroom admins only).
/hotel permissions - All Hotelroom Permissions.
/hotel users - List all Players with Hotelroom Permissions.
/hotel setprice {Price} - Change the Rent Price. (Changes the category Settings)
/hotel settime {Time} - Change the Rent Time. (Changes the category Settings)
/hotel reset - Reset the Hotelroom, so it can get a new Owner.
/hotel delete - Delete the Hotelroom completly.
/hotel updateBackup - Creates a new Backup of the current Hotel Area
/hotel buy {shopId} - Rent a specific Hotelroom.
/hotel info - Get informations from the Hotelroom you are standing in.
/hotel info {ID} - Get informations of the Hotel with the ID.
/hotel door add {ID} - Add Doors to a Hotelroom.
/hotel door remove - Remove a door from a Hotelroom.
/hotel door open - Open the doors in your own Hotelroom.
/hotel door close - Close the doors in your own Hotelroom.
/hotel setAlias {alias} - Set a different Name for the Hotelroom.
/hotel setAliasCat {catAlias} - Set a different Name for the Category of the Hotelroom you are standing in.
/hotel resign - Ends your running Contract.

Permissions:

All Permissions can be found in the config. You could also change the name of the permission.

rentit.shop - Permission for all Shop Commands
rentit.hotel - Permission for all Hotel Commands
rentit.sign - Creating a Shop or Hotel sign
rentit.build - Build bypass in Shops and Hotels

PlaceholderAPI:

%rentit_currentId% - returns the ID of the Hotel/Shop, that the player is standing in.
%rentit_currentType% - returns the Type (Hotel/Shop), that the player is standing in.
%currentOwner% - returns the Owner of the Shop/Hotel, that the player is standing in.

Installation:

Dependencies:

This Plugin needs to have Vault installed, so that I can support nearly any Economy System. Worldedit for the calculations. Citizens is needed for PlayerNPCs! You can turn them off in the config and dont need to use Citizens (Options.useNPCs = false)

Soft-Dependencies:

WorldGuard is supported. There will be no build errors in hotel/shop areas, if it is f.e. in the Spawn Saved Area.

TODO:

  1. Put all the .jars (worldedit.jar, vault.jar, citizens.jar*, rentit.jar) and your Economy Plugin in your "/plugins/" directory of your server.
  2. Then please restart the Server
  3. It will create the config in the "RentIt" Folder. You need to edit the config and insert your database connection to make it work. Please use the Fork MariaDB, since MySQL doesn't work
  4. (optional) Look through the Config entrys and customize the language and setting to your like!
  • SoftDependency

How To Use:

Shop Setup for Admins:

  1. Create a category for the Shop. f.e. /shop createCat 1 100 9 7D This means if a player wants to rent a Shop, with the category ID 1, then he has to pay 100$ every 7 Days. The Shop Slot Size will be 9. IMPORTANT: (Date letters need to be case sensitive)
  2. Then you need to select a square. (f.e. the air in a room). Players will be able to build in that region. So please watchout that you dont select Stuff, that players shouldnt break.
  3. Run then the command /shop setArea 1 to link that region with the Category. Your standing Position will be the teleport place for players.
  4. After that you need to set the NPC Location (/shop setNPC). That one is the Shop Interacter later on.
  5. Create then a Sign for the Players. (Permission: rentit.sign) [Shop] %ShopID%

With Shift+Rightclick Admins can change the category settings.

Hotel Setup for Admins:

  1. Create a category for the Hotel. f.e. /hotel createCat 1 100 7D This means if a player wants to rent a hotelroom, with the category ID 1, then he has to pay 100$ every 7 Days. IMPORTANT: (Date letters need to be case sensitive)
  2. Then you need to select a square. (f.e. the air in a room). Players will be able to build in that region. So please watchout that you dont select Stuff, that players shouldnt break.
  3. Run then the command /hotel setArea 1 to link that region with the Category. Your standing Position will be the teleport place for players.
  4. Create then a Sign for the Players. (Permission: rentit.sign) [Hotel] %HotelID%

With Shift+Rightclick Admins can change settings. They will be effected on the category.

Category Settings:

This are Settings in the Config for specific Categories for Shops and Hotelrooms:

usePermission -> Are Permissions needed, to buy such a Shop/Hotel
autoPaymentDefault -> The Default Status of the auto Payment
autoPaymentDisabled -> If auto Payment should be changeable
maxRentExtendAmount -> The Max Amount a Player can extend the rent
disableDoorCommand -> Disables the door command
ownerBypassLock -> Should Owner or Players with Permission be allowed to open locked doors
doorsClosedUntilBuy -> <true/false> Should the doors be closed until a player bought the Shop/hotelroom? True Allows player to look, until someone rents it and does /shop door close
doorsClosedAfterBuy -> the default status, after a player bought a Shop or Hotelroom
allowUsersToMoveNPC -> Allows Shop Owners to use the /shop setnpc command and to move their NPC.
reminderRentRunningOut -> Reminds the owner the given time before the rent end, if no auto payment enabled, that the rent is going to end.

     categorySettings:
         ShopCategory:
             1:
                 usePermission: false
                 autoPaymentDefault: true
                 autoPaymentDisabled: true
                 maxRentExtendAmount: 5
                 disableDoorCommand: false
                 ownerBypassLock: true
                 doorsClosedUntilBuy: false
                 doorsClosedAfterBuy: false
                 reminderRentRunningOut: '1m30s'
             2:
                 usePermission: true
                 autoPaymentDefault: true
                 autoPaymentDisabled: false
                 maxRentExtendAmount: 3
                 disableDoorCommand: false
                 ownerBypassLock: true
                 doorsClosedUntilBuy: false
                 doorsClosedAfterBuy: false
         HotelCategory:
             1:
                 usePermission: false
                 autoPaymentDefault: true
                 autoPaymentDisabled: false
                 maxRentExtendAmount: 5
                 disableDoorCommand: false
                 ownerBypassLock: true
                 doorsClosedUntilBuy: false
                 doorsClosedAfterBuy: false
                 reminderRentRunningOut: '1m'
             2:
                 usePermission: true
                 autoPaymentDefault: true
                 autoPaymentDisabled: false
                 maxRentExtendAmount: 3
                 disableDoorCommand: false
                 ownerBypassLock: true
                 doorsClosedUntilBuy: false
                 doorsClosedAfterBuy: false

Shop Use for Players:

To rent a Shop, the player only needs to click on a Sign and accept the contract.

  • He then can give a friend f.e. the permission to "build", "sell", "buy", "fill" or all the permissions with "admin". (listet with /shop permissions) See "Permissions" for more information.
  • To give a Player a Permission, the owner of the Shop needs to run: /shop setpermission <true/false>
  • Selling Items works with /shop sellitem . It will sell the Item with the exact amount in the players hand for the given price. After that he can create Chests with more Items in it. The Shop will sell then first the Storage Item.
  • To buy an Item from players, the Player needs to use /shop buyitem to buy the item in the hand or /shop buyitem to buy another item with a custom amount. The items will be filled in a shop chest with free space.
  • If the players doesnt want to get an information, he can use /shop noinfo to disable it for a specific shop.

Hotel Use for Players:

To rent a Hotelroom, the player only needs to click on a Sign and accept the contract.

  • He then can give a friend f.e. the permission to "build" or all the permissions with "admin". (listet with /hotel permissions) See "Permissions" for more information.
  • To give a Player a Permission, the owner of the Hotelroom needs to run: /hotel setpermission <true/false>

Permissions:

build - build permission
fill - can interact with chest, to fill items in it or remove them
sell - selling Items in the Shop with the command /shop sellitem...
buy - buying Items in the Shop with the command /shop buyitem..
door - allows to go through locked doors and be able to un/lock them.
admin - all permissions

Time Format:

Y – Years
M – Months
D – Days
H – Hours
m – Minutes

Contact Informations:

Discord:

Spigot:

https://www.spigotmc.org/threads/rentit-shop-and-hotel-renting.495468/

If you like this plugin, please consider to rate it on Spigot. And if you like to donate.
New Bugs will be shortly fixed!