All resources

rsg-robbery — Developer Docs (v3.1.0)#

Overview#

Player-to-player robbery: target a player with hands up via rsg-target, cuff them, and open their inventory. Victims can be uncuffed by the robber, by another player, or auto-uncuff after Config.AutoUncuffTime.

Dependencies#

  • rsg-core (locales, notify)
  • rsg-inventory (with the one-line cuffed-target fix from the README)
  • rsg-target

No ox_lib dependency — locales load from @rsg-core/shared/locale.lua and notifications use RSGCore:Client:Notify.

Files#

FilePurpose
shared/config.luaDistances, cooldown, auto-uncuff timer
client/client.luarsg-target global player options (rob_player, uncuff_player), cuff animation/effects
server/server.luaValidation (distance, cooldown, handcuffs item, vehicle, cuffed state), cuff metadata, uncuff, auto-uncuff
server/versionchecker.luaChecks GitHub for updates
locales/*.jsonen, de, el, es, fr, ja, nl, pl, pt-br, ro, ru

Config#

KeyDefaultDescription
Config.RobDistance2.5Max distance to rob
Config.CuffDistance1.5Max distance to cuff
Config.RobCooldown30000ms between robberies
Config.AutoUncuffTime120000ms before auto-uncuff (0 = off)
Config.Reputation.EnabledtrueReport robberies to rsg-reputation (optional resource)
Config.Reputation.Action'robbery'rsg-reputation action applied to the robber

rsg-reputation integration#

In rsg-robbery:server:confirmrobbery, once the victim has confirmed (hands up) and has been cuffed, the server calls exports['rsg-reputation']:ApplyAction(robberId, Config.Reputation.Action). The honor change comes from rsg-reputation's Config.Actions (default robbery: -15 honor). No region is passed, so standing is not changed. The call is skipped when rsg-reputation is not started, and it runs only after the existing server-side checks (distance, cooldown, state) have passed.

Localisation#

Set the language with setr rsg:locale <code>. Keys live under robbery.*.

Security#

All checks (distance, cooldown, item, state) are server-side; client target options only request the action.

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

Technical reference#

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

Dependencies#

rsg-core, rsg-inventory, rsg-target

Configuration#

OptionDefaultNotes
Config.RobDistance2.5
Config.CuffDistance1.5
Config.ConsumeHandcuffsfalse
Config.RobCooldown30000
Config.HandcuffItem'handcuffs'
Config.AutoUncuffTime120000

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-robbery:client:verifyhandsupclientrobberIdclient/client.lua
rsg-robbery:client:getcuffedclient``client/client.lua
rsg-robbery:client:uncuffedclient``client/client.lua
rsg-robbery:server:robplayerservertargetIdserver/server.lua
rsg-robbery:server:confirmrobberyserverrobberIdserver/server.lua
rsg-inventory:server:closeInventoryserverinventoryserver/server.lua
rsg-robbery:server:uncuffplayerservertargetIdserver/server.lua
-- from a client script
TriggerServerEvent('rsg-robbery:server:robplayer', targetId)
-- from a server script
TriggerClientEvent('rsg-robbery:client:verifyhandsup', source, robberId)

Commands#

CommandNotesFile
/uncufflocale('robbery.uncuff_self_help')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 -->