About WTrading
WTrading is a highly optimized and feature-packed trading system designed to make item exchanges seamless and efficient. Players can trade from anywhere on the map using Rust's built-in shopfront loot menu, providing a polished and intuitive interface. Server owners have full control with extensive configuration options, including trade restrictions, custom fees, logging, and third-party integrations to fine-tune the trading experience.
The system is built for flexibility and security, ensuring safe transactions with anti-exploit measures and detailed logging. The optional Discord integration allows administrators to monitor trades in real time, review logs, and issue trade bans directly from Discord, streamlining server management without requiring in-game access. Whether you're running a roleplay economy or a survival-focused server, WTrading delivers a powerful and customisable solution for player-to-player trading.
Features
- Easy and and simple setup.
- UI based player list with searching.
- On-screen notifications and sound effects.
- Fixed and dynamic trade fees based on distance via Economics or Server Rewards.
- Temporary and permanent trade banning system.
- Built-in Discord integration with external moderation functionality.
- Group specific trade cooldowns.
- Daily limits per group.
- Trade slot limits and visual indicators.
- Usage and bypass permissions.
- Item blacklisting.
- Several toggleable trade restrictions.
- Many in-depth third party plugin integrations.
- Configurable UI positioning and visibility.
- In-depth developer interface.
- Full localisation support.
- Toggleable file or console based logging.
Commands
- /trade {target} - Sends a trade request to the target.
- /trade accept [target] - Accepts the most recent trade request, or the target player's request if specified.
- /trade decline [target] - Declines the most recent trade request, or the target player's request if specified.
- /trade cancel - Cancels your ongoing trade.
- /trade ban {target} {time} - Trade bans the target player for the given length which can be set using the following format: 1h 30m 5s.
- /trade unban {target} - Removes the trade ban from the target player.
Integrations
WTrading includes a vast set of integrations with existing plugins that can be found for free on UMod:
- Server Rewards by k1lly0u - Take fees for sending trade requests which can scale based on distance.
- Economics by MrBlue - Take fees for sending trade requests which can scale based on distance.
- Clans by k1lly0u - Reduce cooldowns, fees and disable daily trade limits for trades between clan members.
- No Escape by Calytic - Prevent raid blocked or combat blocked players from trading.
- UI Notify by Mevent - Receive on-screen notifications that fit the style of your server when a trade request is received.
- NTeleportation by nivex - Target players in commands easier by using the same Temp ID as NTeleportation.
- Block Users by ViolationHandler - Prevent players from sending trade requests to people who've blocked them.
- Ignore by MisterPixie - Allow players to ignore inbound requests from specific people.
- AFK API by 2CHEVSKII - Prevent confusion from unanswered trade requests sent to AFK people.
Permissions
- wtrading.use - Allows the player to use trade related commands
- wtrading.cooldown_bypass - Any player with this permission will bypass the trade cooldown.
- wtrading.daily_limit_bypass - Any player with this permission will bypass the daily trade limit for their group.
- wtrading.block_bypass - Any player with this permission will bypass user blocking restrictions.
- wtrading.ban - Allows the player to issue trade bans with /trade ban {player}.
- wtrading.ban_immune - Any player with this permission will be immune to trade bans.
- wtrading.unban - Allows the player to remove trade bans with /trade ban {player}.
Installation
- Download the latest version of WTrading.
- Open the zip file using the archive extraction tool of your choice.
- Drag and Drop WTrading.cs into oxide/plugins/.
- (Optional) For those that wish to use the Discord integration, copy WTradingDiscord.cs into the same folder.
- Generate the configuration files by running the server with the plugin installed.
- Configure the files located in oxide/config/, refer to the Configuration section for more information on the options available.
- Reload the plugin using the commands oxide.reload WTrading, and oxide.reload WTradingDiscordif you are using the Discord integration.
Configuration
The following configuration files are available, refer to the inline comments for further explanation:
WTrading.json
Quote
{
"request_repeats": 3, //How many times the trade request notification will be sent before timing out.
"request_timeout": 60.0, //How many seconds the trade request will wait before timing out.
"accept_delay": 0.5, //How many seconds to wait after accepting a trade before opening the trade window.
"trade_cooldowns": { //How long each group needs to wait before trading again in seconds.
"default": 60,
"admin": 30
},
"cancel_cooldown": 5, //How many seconds players must wait before trading after cancelling another.
"daily_limits": { //How many trades each group can make per day, -1 for unlimited.
"default": 5,
"admin": -1
},
"daily_limit_creator_only": false, //Whether the daily limit is only applied to the creator of the trade.
"slot_limits": { //How many items each group can trade at once.
"default": 6,
"admin": 12
},
"chat_prefix": "[WTrading]", //The prefix for all WTrading chat messages, set to "" to disable.
"onscreen_notifications": {
"enabled": true, //Whether to show onscreen notifications upon receiving a trade request.
"anchor": { //The anchor point for the notification.
"x": 0.5,
"y": 0.0
},
"offset": { //The offset from the anchor point for the notification.
"x": 0.0,
"y": 180.0
}
},
"player_list": {
"enabled": true, //Whether using /trade with no arguments should show a list of players.
"anchor": { //The anchor point for the player list.
"x": 0.5,
"y": 0.5
},
"offset": { //The offset from the anchor point for the player list.
"x": 0.0,
"y": 0.0
}
},
"sound_notifications": true, //Whether to play a sound upon receiving a trade request and completing a trade.
"building_block": true, //Whether building blocked players should be prevented from trading.
"require_building_auth": false, //Whether players must be near their TC to trade.
"fee": 100.0, //The fee to take per trade.
"fee_per_metre": 0.0, //The price per metre to add to the trade fee.
"refunds": true, //Whether refunds should be given if a trade is cancelled.
"item_blacklist": [ //Items that cannot be traded.
"rock",
"torch"
],
"integrations": {
"temp_ids": true, //Whether TempIDs or NTeleportation's ID system should be used to help target players.
"ui_notify": true, //Whether UI Notify should be used to show trade requests.
"block_users": true, //Whether Block Users should be used to prevent blocked players from trading.
"ignore": true, //Whether Ignore should be used to prevent ignored players from trading.
"afk_api": true, //Whether AFK API should be used to prevent trade requests to AFK players.
"no_escape": {
"raid_block": true, //Whether raid blocked players should be prevented from trading.
"combat_block": true //Whether combat blocked players should be prevented from trading.
},
"server_rewards": false, //Whether Server Rewards should be used to charge trade fees.
"economics": false, //Whether Economics should be used to charge trade fees.
"clans": {
"enabled": false, //Whether Clans should be enabled.
"fee_discount": 0.5, //The discount to apply to trade fees between clan members.
"no_limits": true, //Whether to ignore daily limits for trades between clan members.
"cooldown_multiplier": 0.8 //The multiplier to apply to trade cooldowns between clan members.
}
},
"file_logging": true, //Whether trade activity should be logged to a file.
"console_logging": true //Whether trade activity should be logged to the server console.
}
WTradingDiscord.json
This configuration file is for users of the Discord integration only.
Quote
{
"discord_bot_token": "", //The Discord bot token to use for the integration, visit https://github.com/dassjosh/Oxide.Ext.Discord/tree/develop#getting-your-api-key for more information.
"logs_channel": "1343240715202723925", //The Discord channel ID to send logs to.
"embed_color": 15548997, //The color to use for Discord embeds in decimal format.
"server_name": "Server 1", //The name of the server to use in Discord messages.
"default_ban_time": "2h 30m", //The default time to use for trade bans issued via Discord.
"ban_role_ids": ["1344762185313947698"], //The IDs of Discord roles that can issue trade bans.
"generate_images": true, //Whether image generation should be used to display trade items.
"retain_images": false, //Whether to retain generated images after use.
"log_level": "Warning" //The log level to use for Discord messages, can be any of the following: Verbose, Debug, Info, Warning, Error, Exception, Off.
}
Developer Hooks
WTrading features a range of hooks that developers can use to modify the behaviour of the plugin:
Quotestring WTrading_CanUseCommand(BasePlayer player, string command, string[] arguments) //Return a string to prevent command execution and present an error message.
double WTrading_CalculateFee(BasePlayer caller, BasePlayer target, double fee) //Return a double to modify the fee amount.
bool WTrading_ShouldConsumeDailyTrade(BasePlayer caller, BasePlayer target) //Return a bool override whether daily trades should be consumed.
bool WTrading_ShouldApplyCooldown(BasePlayer caller, BasePlayer target) //Return a bool override whether a cooldown should be applied.
string WTrading_CanSendTrade(BasePlayer caller, BasePlayer target) //Return a string to prevent the trade request and present an error message.
string WTrading_CanAcceptTrade(BasePlayer caller, BasePlayer target) //Return a string to prevent the trade and present an error message.
string WTrading_CanDeclineTrade(BasePlayer caller, BasePlayer target) //Return a string to prevent declining the trade and present an error message.
string WTrading_CanCancelTrade(BasePlayer caller) //Return a string to prevent the cancellation and present an error message.
void WTrading_TradeSent(BasePlayer caller, BasePlayer target) //Executed when the caller sends a trade request to the target.
void WTrading_TradeAccepted(BasePlayer caller, BasePlayer target, ShopFront shopFront) //Executed when the target accepts a trade request.
void WTrading_TradeCancelled(BasePlayer caller, BasePlayer target) //Executed when the trade is cancelled.
void WTrading_TradeComplete(BasePlayer caller, BasePlayer target, ShopFront shopFront) //Executed when the trade is complete.
Localisation
- Localising WTrading is simple, if you would like to translate the plugin into your own language follow these steps:
- Go to the oxide/lang/ folder of your server after installing the plugin.
- Copy the English translation from ./en/WTrading.json and paste it into a folder with your language code (for example fr for French).
- Open the file and change all of the phrases to your language of choice.
Credits
- sky - Help with testing and the video demonstration.
- Plugin.Merge by dassjosh - Singlehandedly making Oxide plugin development bearable.
- Admin Tools by ViolationHandler.exe - Inspiration for the image generation functionality of the Discord integration.