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
endHooks
server/sv_custom.lua and client/cl_custom.lua are open. Fill in these functions to tie the
script to your server:
| Function | File | When |
|---|---|---|
CanRob(src, storeId, kind) | server | Before anything starts. Return false to block it. |
OnRobbed(src, storeId, kind, reward) | server | After loot is paid, with the cash and items. |
OnAlarm(data, src) | server | When the police get the call (used for lb-tablet). data has store, label, coords and reason. |
Log(src, message) | server | Every log line. Sends to your webhook or ox_lib. |
CanRob(kind, storeId) | client | Before anything starts. Blocks dead, cuffed or in-vehicle players by default. |
Dispatch(data) | client | The 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).
| Action | What it does |
|---|---|
status | One 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 all | Reset every store |
prize <id> <item> | Put a prize in the centre display, by item name or its number in R.Display.prizes |
diag | Prints your robbery steps to the server console, for bug reports. Run it again to turn it off |