Skip to content
Documentation
Robberies5Jewelry Robbery

r_jewelryrobbery Exports & Commands

r_jewelryrobbery server exports, the hooks in the custom files and the admin command.

Server exports

A store's id is its id in shared/config_stores.lua. The shipped store is 'vangelico'.

ResetStore

Ends the robbery and the cooldown of one store and puts the staff back, or every store with 'all'. Returns true when it worked.

exports.r_jewelryrobbery:ResetStore('all')

IsBeingRobbed

true while the robbery is on, for R.Robbery.activeTime minutes after it starts. With no id it checks 'vangelico'.

if exports.r_jewelryrobbery:IsBeingRobbed('vangelico') then
    -- robbery in progress
end

Hooks

server/sv_custom.lua and client/cl_custom.lua are open. Fill in these functions to tie the script to your server:

FunctionFileWhen
CanRob(src, storeId, kind)serverBefore anything starts. Return false to block it.
OnRobbed(src, storeId, kind, reward)serverAfter loot is paid, with the cash and items.
OnAlarm(data, src)serverWhen the police get the call (used for lb-tablet). data has store, label, coords and reason.
Log(src, message)serverEvery log line. Sends to your webhook or ox_lib.
CanRob(kind, storeId)clientBefore anything starts. Blocks dead, cuffed or in-vehicle players by default.
Dispatch(data)clientThe police alert. Add your dispatch script under custom.

kind is 'start', 'case', 'painting', 'display', 'wall', 'door' or 'safe'. OnRobbed gets 'case', 'painting', 'display', 'wall' or 'safe'. The server CanRob is also asked before the fence buys, with storeId and kind both 'fence'.

Admin command

/jewelryrobbery <action> for R.Admin.group (admin and god by default).

ActionWhat it does
statusOne line per store: phase, cases, paintings, display and prize, wall displays, door and safe, gas, alarm and reset time
reset <id>Reset one store
reset allReset every store
prize <id> <item>Put a prize in the centre display, by item name or its number in R.Display.prizes
diagPrints your robbery steps to the server console, for bug reports. Run it again to turn it off