Features
- UI store with a customizable color scheme
- The plugin functions as both a store and a bank, keeping track of its own currency RP
- Allow users to purchase items, kits and command sets
- Assign permissions to products so only VIPs can access them
- Allow users to sell items back to the store
- Allow users to exchange RP for Economics and vice versa
- Allow users to transfer RP to other players
- Optional logging of all transactions and player balances
- Setup NPC stores using HumanNPC with either their own items for sale, or as a way to interact with the main store
Permissions
This plugin uses the permission system. To assign a permission, use oxide.grant <user or group> <name or steam id> <permission>. To remove a permission, use oxide.revoke <user or group> <name or steam id> <permission>.- serverrewards.admin - Required for players without auth level 2 (owners) to edit anything store related.
Chat Commands
- /s - Opens the store. This command can be changed in the config file
Admin RP Management Commands
This command can be changed in the config fileChat
- /rp add <username|userid|*> <amount> - Add the specified amount of RP to a player
- /rp take <username|userid|*> <amount> - Deduct the specified amount of RP from a player
- /rp clear <username|userid|*> - Reset the specified players RP to 0
- /rp check <username|userid> - Show the amount of RP a player has
Console
- rp add <username|userid|*> <amount> - Add the specified amount of RP to a player
- rp take <username|userid|*> <amount> - Deduct the specified amount of RP from a player
- rp clear <username|userid|*> - Reset the specified players RP to 0
- rp check <username|userid> - Show the amount of RP a player has
Adding, Editing and Removing Products
All the store management is done via the user interface.A 'ADMIN MODE' button will appear in the bottom left of the menu for users with auth level 2, or the serverrewards.admin permission.
When admin mode is enabled, the purchase buttons for each product will be replaced with a EDIT and DELETE button, and a ADD PRODUCT button will appear in the footer for each product category.
The Add Product and Edit buttons will open the same menu to either create or edit the product.
Once done click CONFIRM to save your changes.
Command Products
Command product allow the player to run pre-defined server commands upon purchase.You can place specific variables int these commands which will be replaced prior to the command being run.
For example, the command inventory.giveto $player.id wood 100 will replace $player.id with the purchasing users ID
The current variables you can use in a command are:
$player.name - The purchasing players display name
$player.id - The purchasing players user ID
$player.x, $player.y, $player.z - The purchasing players world position
Exchange
You can opt to allow users to exchange currency between Economics and ServerRewards. The user will be presented with 2 options, to exchange RP for Economics or vice-versa. They simply enter the amount they want to exchange and press CONVERTYou can set your own exchange rate in the configuration (default 1-to-1)
Transfer
You can opt to allow users to transfer RP to other players in the config file. The user will be prompted to select a active player on the server and input an amount of RP to transferSellable Items
You can opt to allow users to sell items back to the store. The plugin will keep a list of all the items in the game, and by default they are all set to disabled.To enable a item to be sold back to the store you need to set a sale price. You can do this either via the console command provided above, or by manually editing the data file located at /oxide/data/ServerRewards/sell_prices.json
The sell data contains each item in the game, with a sale price, a skin multiplier and a list for specifying skin price overrides.
By default a skinned item will sell for the (Price * Price multiplier for skin variants), this can be overridden using the sr.sellable setprice command and providing the skin ID of the skin you want a specific price for.
The store will not accept broken items and the final price of a item being sold back to the store will be adjusted to suit its current condition (if applicable)
Console Commands
- sr.sellable setprice <shortname> <price> <opt:skinID> - Sets the sell price for a item. If you supply a skin ID it the override price for that skin only
- sr.sellable setskinmult <shortname> <multiplier> - Sets the price multiplier for skin variants. This does not apply to skin override prices
- sr.sellable show <shortname> - Show the price, skin multiplier and skin override prices for a item
NPC Stores
NPC stores use NPCs from the HumanNPC plugin.NPC stores can either be a portal into the main store, or they can define their own products and categories.
By default, upon creating a NPC store, it will just open the main store page. You can add and remove NPC stores using the commands provided below.
You can set a custom store name for NPCs which is shown in the top left of the UI. This is only applicable when custom store is enabled.
To change which categories a NPC store gives access to, you can use the /srcnpc togglenav command followed by one of the category arguments items|kits|commands|exchange|transfer|sell which will toggle that category on or off.
To run custom products in the store you will need to enable custom store mode by typing /srnpc customstore.
If the NPC is a custom store, you can add/edit/remove products the same way you do in the main store via the UI.
If your NPC store only has TRANSFER or EXCHANGE categories, it will only open the store into those menus, and close the store when leaving those menus
Chat Commands
- /srnpc add - Turn the NPC you are looking at into a store NPC
- /srnpc remove - Remove the store from the NPC you are looking at
- /srnpc setname <name> - Sets a store name for the NPC you are looking at. This name is shown on the store page if custom store is enabled
- /srcnpc nav <items|kits|commands|exchange|transfer|sell> - Toggles whether the specified navigation type is show in the NPC store
- /srnpc customstore - Toggles whether this NPC runs a custom store or just opens the global store
Updating to V2.x.x - Read before updating!
Before updating, make a backup of your configuration file and data files located in /oxide/data/ServerRewards/Version 2.x.x uses a completely different configuration file, so you will need to reapply your changes manually.
The plugin will detect when the update has occured and attempt to automatically convert your previous data files to the new format. Your old data files will be moved to /oxide/data/ServerRewards/v1/
If for any reason this does not work, or you need to do the conversion manually, you can use the console command sr.convert
Regarding NPC Stores
The previous version of ServerRewards linked products in a custom NPC store back to a product from the main store. Version 2.x.x does not do this, custom NPC stores now keep their own list of products.