All resources

rsg-fishmonger – Docs (v3.2.0)#

Contents#

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

1. Files#

FilePurpose
fxmanifest.luaManifest; depends on rsg-core, rsg-inventory, rsg-target
shared/config.luaNPC, locations, hours, demand, bonus, stock, shop, fish prices
shared/utils.luaShared helpers
client/client.luaNPC spawning, blips, targets, NUI bridge
server/server.luaMenu data, checkout, daily demand and stock, shop
server/sv_config.lua, server/webhook.luaWebhook settings and Discord logs
server/versionchecker.luaGitHub version check
html/NUI cart menu
locales/*.jsonen, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

2. How it works#

  • 8 fishmonger NPCs: Saint Denis, Blackwater, Valentine, Rhodes, Annesburg, Van Horn, Tumbleweed and the river trading post, each with an optional blip.
  • Use rsg-target on the NPC to open a cart menu. Sell fish for money (cash, bank or bloodmoney) or process them into fillets (raw_fish by default).
  • Daily demand: each town rolls a price multiplier every real day (80%–125%).
  • Seller bonus: extra pay from fishing rep (earned per fish traded) and optional per-job bonuses.
  • Daily stock: each town only buys a set number of fish per day; the count survives restarts. Processing is not limited.
  • Supplies shop: buy bait and lures from the same NPC (an rsg-inventory shop per town).
  • Fillet types: any fish can give its own fillet item.
  • Opening hours (optional) use the rsg-weather in-game clock.

rsg-economy (3.2.0): in checkout (sell mode) the total is passed to exports['rsg-economy']:Quote(src, { region = GetRegionAt(loc.coords), mode = 'sell', base = total, qty = 1, market = false }), the payout uses quote.total, and Record(src, quote) runs after AddMoney succeeds. Config: Config.Economy.Enabled.

3. Configuration#

shared/config.lua:

OptionDefaultMeaning
NpcModelcs_fishcollectorNPC model
SpawnDistance50.0NPC spawn/despawn range
TargetDistance2.5rsg-target range
MaxUseDistance5.0Server-side distance check
Cooldown2000ms between checkouts
MoneyType'cash'cash, bank or bloodmoney
FilletItem'raw_fish'Default fillet item
Bliptableenabled, sprite, style
Locationslist{ key, coords, hours?, demand?, stock? }; display name comes from locale loc_<key>
OpeningHourstableenabled, open (6), close (22); wraps past midnight; per-location hours override
Demandtableenabled, min 0.80, max 1.25; demand = false on a location for base price
Bonustablejobs (job → fraction) and rep (name, perPoint, max 0.15, gainPerFish)
AutoDatabasebooleantrue creates rsg_fishmonger_stock on start; false = import install.sql yourself
DailyStocktableenabled, perLocation (200); per-location stock (0 = unlimited)
Shoptableenabled, persistentStock, items (name, price, amount)
Fishtablefish model → { price, fillets, fillet? }

Example, a fish with its own fillet:

['a_c_fishsalmonsockeye_01_lg'] = { price = 2.75, fillets = 3, fillet = 'salmon_fillet' },

Webhook URLs are in server/sv_config.lua.

4. Events, callbacks and commands#

NameSideNotes
rsg-fishmonger:server:getMenuDatacallback(locationIndex) prices, stock, owned fish
rsg-fishmonger:server:checkoutcallback(locationIndex, mode, cart) sell or process
rsg-fishmonger:server:openShopserver event(locationIndex) supplies shop
CommandWhoWhat
/fishmonger_webhooktestadminSend a test webhook

5. Security#

The server checks distance to the NPC, opening hours, cooldown, that the fish are accepted and owned, daily stock, and computes prices itself (demand, bonus). The cart from the client only lists items and amounts.

6. How-tos#

  • Add a fish: add its model to Config.Fish and make sure the item exists.
  • Stop daily stock limits: DailyStock.enabled = false.
  • Bait item names should match rsg-fishing's baits.

7. Troubleshooting#

ProblemFix
NPC closedOpeningHours.enabled and rsg-weather's clock
"Town stock full"Wait for the next real day or raise perLocation
Shop items missingItem must exist in rsg-core items
Fish not listedMissing from Config.Fish

rsg-skills integration#

Config.Bonus.skill = { enabled, name, perk }. bonusFor(Player) reads exports['rsg-skills']:GetPerk(src, name, perk) on the server (a percent, so 10 becomes +0.10) and adds it to the job and rep bonus. It is applied on the server for the payout and for the bonus sent to the UI. Skipped when rsg-skills is not started.

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-fishmonger 3.1.0. Names, arguments and defaults below are read straight from the code.

Dependencies#

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

Database#

rsg_fishmonger_stock: location (primary key, the location key), day (YYYY-MM-DD of the last sale), sold (fish sold that day). The server keeps a copy in memory and writes every sale through. Created automatically while Config.AutoDatabase = true; otherwise import install.sql. No resource KVP is used, so the server creates no db folder.

Configuration#

OptionDefaultNotes
Config.NpcModelcs_fishcollector
Config.SpawnDistance50.0npc spawns / despawns at this range
Config.TargetDistance2.5rsg-target interaction distance
Config.MaxUseDistance5.0server-side distance check to the npc
Config.Cooldown2000ms between checkouts per player (anti-spam)
Config.MoneyType'cash''cash' | 'bank' | 'bloodmoney'
Config.FilletItem'raw_fish'
Config.ImagePath'nui://rsg-inventory/html/images/'
Config.Bliptable
Config.Locationstable
Config.OpeningHourstable
Config.Demandtable
Config.Bonustable
Config.DailyStocktable
Config.Shoptable
Config.Fishtable

Callbacks#

CallbackSideArgumentsFile
rsg-fishmonger:server:getMenuDataserversource, cb, locationIndexserver/server.lua
rsg-fishmonger:server:checkoutserversource, cb, locationIndex, mode, cartserver/server.lua
-- client side
RSGCore.Functions.TriggerCallback('rsg-fishmonger:server:getMenuData', function(result)
    -- use result
end, locationIndex)

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
rsg-fishmonger:server:openShopserverlocationIndexserver/server.lua
-- from a client script
TriggerServerEvent('rsg-fishmonger:server:openShop', locationIndex)

Commands#

CommandNotesFile
/fishmonger_webhooktestlocale('cmd_webhooktest_help')server/webhook.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 -->