All resources

rsg-auction – Docs (v3.1.0)#

Contents#

  1. Files
  2. How it works
  3. Configuration
  4. Events and commands
  5. Database
  6. Security
  7. Server owner how-tos
  8. Troubleshooting

1. Files#

FilePurpose
fxmanifest.luaManifest; depends on rsg-core, rsg-inventory, rsg-target, oxmysql
shared/config.luaCategories, limits, fees, blacklist, auctioneer NPCs
shared/money.luaMoney helpers
client/main.lua, client/npc.luaNUI bridge, auctioneer NPCs
server/main.luaAuctions, bids, escrow, collections
server/database.luaAutomatic table creation
server/sv_config.lua, server/webhooks.luaWebhook settings, Discord embeds and admin commands
server/versionchecker.luaGitHub version check
web/React/Tailwind NUI source; web/dist/ is the built UI that the resource loads
installation/rsg-auction.sqlManual database install
locales/*.jsonen, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

2. How it works#

  • Town-specific auction houses: each auctioneer NPC runs its own market (Valentine, Rhodes, Saint Denis, Blackwater, Armadillo by default). Players see only the auctions for the town they are in.
  • Live bidding: every open UI updates when someone bids, an auction ends or is cancelled.
  • Escrow: listed items and bids are held by the server. Outbid players are refunded automatically (to the bank if online, queued if offline).
  • Buyout: optional "Buy Now" price, at least Buyout.minMultiplier times the start bid. Disabled once bidding passes it.
  • Anti-snipe: a bid in the final window seconds extends the auction to extendBy seconds.
  • Collection kiosk: won items, returned items and sale earnings wait at any auctioneer. Earnings from several sales add up.
  • Creation fee: baseFee + durationMultiplier × hours + quantityMultiplier × quantity, capped, with a live preview.
  • Categories, search (name, label or auction ID) and pagination; "All" and "My Auctions" views. Login reminders for waiting items or money.

3. Configuration#

shared/config.lua:

OptionDefaultMeaning
Categorieslistid, label, icon, description (weapons, ammunition, clothing, food, resources, pelts, medicine, tools, valuables, other)
MinStartingBid0.01Minimum starting bid
MinDuration / MaxDuration / DefaultDuration60 / 604800 / 3600Seconds
MaxAuctionsPerPlayer10Active auctions per player
MaxPrice1000000Max bid/buyout
HistoryRetentionDays7Days finished auctions are kept
AntiSnipetableenabled, window (60), extendBy (120)
RateLimitstablems between create, bid, buyout, collect, cancel actions
MinBidIncrement0.055% minimum raise
Buyouttableenabled, minMultiplier (1.5)
CreationFeetableenabled, baseFee, durationMultiplier, quantityMultiplier, maxFee, minFee
BlacklistedItemslistItems that can't be auctioned (money items)
AuctioneerNPCslistmodel, coords, heading, name, location (decides which town's market)

Webhook URLs are in server/sv_config.lua.

4. Events and commands#

NameSideNotes
auction:server:getAuctionsserver event(location)
auction:server:searchAuctionsserver event(params)
auction:server:createAuctionserver event(data)
auction:server:placeBidserver event(auctionId, amount)
auction:server:buyoutAuctionserver event(auctionId)
auction:server:cancelAuctionserver event(auctionId)
auction:server:getPendingCollectionsserver event
auction:server:collectItemserver event(auctionId, itemName)
auction:server:collectMoneyserver event
auction:server:validateNPCInteractionserver eventNPC proximity check
auction:client:update, createResult, cancelResult, collectionResult, notification, webhookResult, openFromNPCclient eventsUI updates
CommandWhoWhat
/auctionwebhookadminManage Discord webhooks in game
/auctionwebhooktoggleadminTurn a webhook type on or off
/auctionwebhookstatusadminShow webhook status

5. Database#

Created automatically on start: rsg_auctions, rsg_auction_bids, rsg_auction_collections, rsg_auction_payouts. Import installation/rsg-auction.sql if automatic creation fails.

6. Security#

Everything is validated on the server: distance to an auctioneer, ownership and quantity of the item, price limits, per-action rate limits, and the blacklist. Items and bids are held in escrow; the client only sends requests.

7. How-tos#

  • Add a town: add an AuctioneerNPCs entry with a new location.
  • Edit the UI: change web/ and rebuild into web/dist/ (npm install, then your build script).
  • Language: setr rsg:locale "de" in server.cfg.

8. Troubleshooting#

ProblemFix
UI blankweb/dist/ must exist and be in the manifest files
Can't list an itemIt's in BlacklistedItems, or you hit MaxAuctionsPerPlayer
Money missingCollect it at an auctioneer (collectMoney)
No Discord postsConfigure server/sv_config.lua; check /auctionwebhookstatus

Support the Project : https://rexshack.tebex.store/

<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-auction 3.1.0. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core, rsg-inventory, rsg-target, oxmysql

Database#

Tables: rsg_auctions, rsg_auction_bids, rsg_auction_collections, rsg_auction_payouts.

Tables are created automatically on start while Config.AutoDatabase = true (default). Nothing is ever dropped or overwritten. For a manual install set Config.AutoDatabase = false and import installation/rsg-auction.sql once.

-- shared/config.lua
Config.AutoDatabase = true -- false = import the SQL file yourself

Configuration#

OptionDefaultNotes
Config.AutoDatabasetruebuild the database tables automatically on start (set false and import the SQL file for a manual install)
Config.CategoriestablePlayers select a category when creating an auction
Config.MinStartingBid0.01Auction Settings
Config.MinDuration60
Config.MaxDuration604800
Config.DefaultDuration3600
Config.MaxAuctionsPerPlayer10
Config.MaxPrice1000000
Config.HistoryRetentionDays7
Config.AntiSnipetableAnti-snipe: a bid placed in the last window seconds extends the auction to extendBy seconds
Config.RateLimitstableRate Limiting (milliseconds between actions)
Config.MinBidIncrement0.05Bid Settings
Config.BuyouttableBuyout Price Settings
Config.CreationFeetableFee formula: BaseFee + (DurationMultiplier * hours) + (QuantityMultiplier * quantity)
Config.BlacklistedItemstableItems in this list cannot be auctioned by players
Config.AuctioneerNPCstableAuctions are TOWN-SPECIFIC: players can only see auctions from the town they're in
Config.InteractionDistance2.5NPC Interaction Settings (rsg-target)
Config.NotificationDuration5000Notification Settings
Config.NpcSpawnDistance60.0
Config.DebugfalseDebug

Events#

Server events can be fired by any client, so every handler re-validates the player, the arguments and any permission, distance or cooldown on the server. Never add a reward to a handler without those checks.

EventSideArgumentsFile
auction:client:updateclientpayloadclient/main.lua
auction:client:createResultclientresultclient/main.lua
auction:client:cancelResultclientresultclient/main.lua
auction:client:collectionResultclientresultclient/main.lua
auction:client:notificationclientdataclient/main.lua
auction:client:webhookResultclientdataclient/main.lua
auction:client:openFromNPCclientlocationDataclient/npc.lua
auction:server:getAuctionsserverlocationserver/main.lua
auction:server:searchAuctionsserverparamsserver/main.lua
auction:server:reportMissingImageserveritemNameserver/main.lua
auction:server:createAuctionserverdataserver/main.lua
auction:server:placeBidserverauctionId, amountserver/main.lua
auction:server:buyoutAuctionserverauctionIdserver/main.lua
auction:server:cancelAuctionserverauctionIdserver/main.lua
auction:server:getPendingCollectionsserver``server/main.lua
auction:server:collectItemserverauctionId, itemNameserver/main.lua
auction:server:collectMoneyserver``server/main.lua
auction:server:validateNPCInteractionserverdataserver/main.lua
-- from a client script
TriggerServerEvent('auction:server:getAuctions', location)
-- from a server script
TriggerClientEvent('auction:client:update', source, payload)

Commands#

CommandNotesFile
/auctionwebhookserver/webhooks.lua
/auctionwebhooktoggleserver/webhooks.lua
/auctionwebhookstatusserver/webhooks.lua

Locales#

Language files in locales/: de, el, en, es, fr, ja, nl, pl, pt-br, ro, ru. Set the language with setr rsg:locale "en".

<!-- END AUTO-REFERENCE -->