All resources

rsg-legendary – Docs (v3.1.0)#

Contents#

  1. Files
  2. How it works
  3. Configuration
  4. Exports, 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.luaTrappers, hunt flow, animals, prices, extras
client/client.lua, client/main.jsTrapper, trail, clues, animal, skinning
server/server.luaMaps, hunts, cooldowns, rewards, trophies, groups
server/sv_config.lua, server/webhooks.luaWebhook settings and Discord logs
server/versionchecker.luaGitHub version check
html/NUI trapper shop and trophy board
installation/install.sqlManual database install
installation/shared_items.luaItems to add to rsg-core/shared/items.lua
locales/*.jsonen, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

2. How it works#

  1. Buy a map from the Legendary Trapper (rsg-target). Each legendary shows its price, or the time until it returns if you are on cooldown. Map purchase can require hunting XP (XPRequirement).
  2. Use the map from your inventory. The hunting area and first tracks appear on the map.
  3. Follow the trail: hold E at each set of tracks to inspect them. Each clue reveals the next; after the last (ClueCount) the legendary appears nearby.
  4. Kill and skin it with normal skinning. If a model has no skin prompt, an rsg-target "Skin" option appears after SkinFallbackDelay seconds.
  5. Sell pelts and trinkets back to the trapper. Each player can hunt each legendary once per CooldownHours (default 24).

Extras:

  • Kill quality: kills with a bow, knife, throwing knives or varmint rifle (Quality.PerfectWeapons) are perfect and multiply trinket rewards.
  • Bonus trinket: BonusTrinketChance chance of one extra.
  • Trophy board: a Trophies tab shows the first hunter and fastest hunt per legendary, plus your own kills.
  • Group hunts: the owner runs /invitehunt <id>; the invitee runs /accepthunt. Members see the trail, and rewards are shared with members within ShareDistance of the carcass.
  • Saved hunts survive relogs and restarts until they expire (SaveHunts).
  • Cooldown telegrams through rsg-telegram when a legendary is huntable again.

15 legendaries: bear, buck, boar, wolf, cougar, panther, big horn ram, moose, elk, fox, coyote, bull gator, beaver, pronghorn and Tatanka bison.

3. Configuration#

shared/config.lua:

OptionDefaultMeaning
Trapperslistid, model, coords, blip
TrapperInteractDistance / TrapperServerDistance / TrapperSpawnDistance3.0 / 6.0 / 80.0Distances
MapItem'legendary_map'Map item
HuntDuration3600Seconds a hunt stays active
ClueCount, ClueSpread, RouteToClue3, 120.0, trueTrail
ClueZoneDistance, ClueTargetDistance, CluePromptKey, CluePromptHoldClue prompt
ClueInspectDist, ClueInspectTime, ClueScenario4.0, 5000Inspection
SpawnOffset, ActivateDistance60.0, 120.0Animal spawn
SkinFallbackDelay, SkinTime, DeleteCarriedPelt, SkinMaxDistance15, 8000, true, 6.0Skinning
CooldownHours24Per player, per legendary
MoneyType'cash'Payment account
QualitytableEnabled, PerfectWeapons, TrinketMult (2)
BonusTrinketChance0.10Extra trinket chance
Trophies, Group, SaveHunts, CooldownTelegramtablesExtras (Group: MaxMembers 3, InviteDistance 10, InviteTimeout 60, ShareDistance 30)
XPRequirementtableEnabled, DefaultMinXP (1000), RepName (hunting)
AnimalstablePer animal: model, outfit preset, price, zone centre and radius, aggression, health multiplier, rewards, skin mode
SellPricestableTrapper's price per item

Zone centres are approximate: stand where you want a hunt and update zone (x/y only). Use /legendpreview to pick outfit presets. Webhook URLs are in server/sv_config.lua.

4. Exports, events and commands#

NameSideNotes
GetTrophies(citizenid)server exportA hunter's trophy data
rsg-legendary:server:animalSpawnedserver event(netId) register the legendary
rsg-legendary:client:startHuntclient event(data)
rsg-legendary:client:endHuntclient eventEnd the hunt
rsg-legendary:client:previewclient event(key, preset) outfit preview
CommandWhoWhat
/abandonhunteveryoneAbandon the active hunt
/invitehunt <id>hunt ownerInvite a nearby player (when groups are enabled)
/accepthuntinviteeAccept the invite
/legendpreviewadminPreview an animal's outfit presets

5. Database#

Created and upgraded automatically on start: rsg_legendary_cooldowns, rsg_legendary_trophies, rsg_legendary_hunts. installation/install.sql is the manual option. Add installation/shared_items.lua to your items file and the images to rsg-inventory/html/images.

6. Security#

The server owns the hunt: map use, clue distance, animal registration, skin distance (SkinMaxDistance), cooldowns and rewards. Sales remove items first and refund on failure; inventory space is checked before giving items.

7. How-tos#

  • Move a hunt: edit the animal's zone.
  • Remove the XP gate: XPRequirement.Enabled = false.
  • Without rsg-hunting, the hunting rep is used for the XP check.

8. Troubleshooting#

ProblemFix
Can't buy a mapCooldown, not enough XP, or not near the trapper
No skin promptWait SkinFallbackDelay for the rsg-target Skin option
Hunt gone after restartCheck SaveHunts and the rsg_legendary_hunts table
Animal didn't appearGet within ActivateDistance of the spawn point after the last clue

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-legendary 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_legendary_cooldowns, rsg_legendary_trophies, rsg_legendary_hunts.

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/install.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.Debugfalse
Config.Trapperstable
Config.TrapperInteractDistance3.0rsg-target distance
Config.TrapperServerDistance6.0server-side check for buy/sell
Config.TrapperSpawnDistance80.0trapper ped only exists while a player is this close
Config.MapItem'legendary_map'
Config.HuntDuration60 * 60seconds a started hunt stays active
Config.ClueCount3clues to inspect before the animal appears
Config.ClueSpread120.0clues are scattered this far from the zone centre (metres, 2D)
Config.RouteToCluetruedraw a GPS route to the next clue
Config.ClueZoneDistance40.0clue prompt is armed once you're this close (terrain is loaded)
Config.ClueTargetDistance3.0how close you must be for the 'Inspect tracks' prompt to show
Config.CluePromptKey0xCEFD9220E (RSGCore.Shared.Keybinds['E'])
Config.CluePromptHold1000ms to hold the key
Config.ClueInspectDist4.0server check: player must be this close to a clue
Config.ClueInspectTime5000ms crouch-inspect
Config.ClueScenarioWORLD_HUMAN_CROUCH_INSPECTrdr3_discoveries/animations/scenarios
Config.SpawnOffset60.0animal spawns this far beyond the last clue
Config.ActivateDistance120.0the legendary spawns once you are this close to its spawn point
Config.SkinFallbackDelay15seconds after death before an rsg-target 'Skin' option appears (0 = never). Covers models with no native skin
Config.SkinTime8000ms progress bar for rsg-target skinning
Config.DeleteCarriedPelttrueremove the vanilla pelt the game puts on your shoulder (you get the RSG items instead)
Config.SkinMaxDistance6.0server: player must be this close to the carcass
Config.CooldownHours24per player, per legendary animal
Config.MoneyType'cash'
Config.Qualitytable
Config.Enabledtrue
Config.PerfectWeapons{ WEAPON_BOW, WEAPON_BOW_IMPROVED, WEAPON_MELEE_KNIFE, WEAPON_T`
Config.TrinketMult2
Config.BonusTrinketChance0.100.0 - 1.0
Config.Trophiestable
Config.CacheSec60
Config.Grouptable
Config.MaxMembers3
Config.InviteDistance10.0
Config.InviteTimeout60
Config.ShareDistance30.0
Config.SaveHuntstrue
Config.CooldownTelegramtable
Config.CheckMin5
Config.XPRequirementtablestored as player rep 'hunting'). Each animal can set its own minXP; otherwise DefaultMinXP is used.
Config.DefaultMinXP1000
Config.RepName'hunting'
Config.ZoneBlipStyleBLIP_STYLE_AREABlip styles (rdr3_discoveries/useful_info_from_rpfs/blip_styles)
Config.ClueBlipStyleBLIP_STYLE_OBJECTIVE
Config.Animalstable
Config.SellPricestable

Exports#

Server

ExportArgumentsFile
GetTrophiescitizenidserver/server.lua
-- example
local result = exports['rsg-legendary']:GetTrophies(citizenid)

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-legendary:client:startHuntclientdataclient/client.lua
rsg-legendary:client:endHuntclient``client/client.lua
rsg-legendary:client:previewclientkey, presetclient/client.lua
rsg-legendary:server:animalSpawnedservernetIdserver/server.lua
-- from a client script
TriggerServerEvent('rsg-legendary:server:animalSpawned', netId)
-- from a server script
TriggerClientEvent('rsg-legendary:client:startHunt', source, data)

Commands#

CommandNotesFile
/abandonhuntlocale('cmd_abandon')server/server.lua
/invitehuntlocale('cmd_invite')server/server.lua
/accepthuntlocale('cmd_accept')server/server.lua
/legendpreviewlocale('cmd_preview')server/server.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 -->