RSG Trade — Player-to-Player Trading System for RedM
Script Description
""RSG Trade** is a P2P trading system for items and cash on RedM servers using the rsg-core and rsg-inventory frameworks. Players can exchange items and money through an interactive menu with confirmation and a countdown timer.
Core Gameplay Flow
- Initiate Trade — Aim at a player (Alt key), select “Trade”.
- Trade Request — The target receives a prompt: “Player with ID X wants to trade with you” with “Accept” and “Decline” buttons (Y / N keys work).
- Trade Menu — Both players see their own inventory and trade slots; items and money can be moved with quantity selection.
- Confirmation — Both players check “Ready”; after that, trade slots lock.
- Completion — Clicking “Trade” starts a 5-second countdown, then the exchange is executed and saved to the database.
Security & Reliability Features
- Immediate database save after trade (protection against duping and loss on disconnect)
- Automatic item return if a player disconnects during trade
- Target busy checks: dead, inventory open, map open, handcuffed, lassoed, etc.
- Item movement blocked after both players confirm
What the Buyer (Server Owner) Gets — Fully Open config.lua
The config is fully editable. Server owners can customize behavior and UI to fit their project.
1. Main Settings
Parameter
Description
Example
Config.TradeDistance
Max distance to offer trade (meters)
3.0
Config.TradeSlots
Number of trade slots per player
10
Config.TradeCountdown
Countdown time before finalizing trade (seconds)
5
Config.TradeRequestTimeout
Time to wait for response to trade offer (seconds)
5
Config.InventoryResource
Inventory resource name (if not rsg-inventory)
‘rsg-inventory’
2. Trade Menu Background
Parameter
Description
Config.TradeBackgroundImage
Path to background image: ‘images/trade-bg.png’ or ‘images/custom-bg.png’
Buyers can add custom images to html/images/ and reference them in the config. Instructions are in html/images/README.txt.
3. Ox Target (Interaction Menu on Player)
Parameter
Description
Config.OxTarget.label
Menu item text
Config.OxTarget.icon
Font Awesome icon (e.g. ‘fas fa-handshake’)
4. Animations & Sounds
Parameter
Description
Config.TradeAnim
Animation during trade (dict = ‘’ — disable)
Config.Sounds
Sounds: open, close, itemMove, success, countdown
5. Localization (Config.Locale)
Buyers can replace all texts for their language/server:
- Notifications: requestSent, requestDeclined, tradeSuccess, personBusy, etc.
- Request Window: requestText, btnAccept, btnDecline
- Trade Menu: tradeTitle, panelInventory, panelMyOffer, readyLabel, btnTrade, etc.
- Themes: themeRed, themeBlue, themeGreen, themeTeal, themePurple, themeAmber, themeDark, themeGray, themeOrange
- Neon Effects: neonOff, neonWhite, neonCyan, neonPurple, neonGreen, neonAmber
- Sizes: sizeSmall, sizeNormal, sizeLarge, sizeXLarge
- Background Toggle: bgOn, bgOff
- Dialogs: dialogMoveAmount, dialogReturnAmount, etc.
In-Game Player Settings (No Config Editing Required)
Players can adjust directly in the trade menu:
- Window Size — Button “Size”: Small → Normal → Large → Extra Large
- Theme Color — Button “Color”: red, blue, green, teal, purple, amber, dark, gray, orange
- Neon Glow — Toggle on/off + choose color
- Background Image — Toggle on/off
- Position — Drag window by title bar
Dependencies
- rsg-core
- rsg-inventory
- ox_lib
- ox_target
- oxmysql (server-side)
Installation
- Copy the rsg-trade folder to resources.
- Add ensure rsg-trade to server.cfg.
- Optionally edit config.lua and add custom images to html/images/, then include them in fxmanifest.lua under the files section.


