Skip to main content

zydrec-robbery-lib

Installation

Keep the resource folder name as:
Renaming the resource is not supported and may break exports, events, or external integrations.

Configuration

Configuration is located in:
Available settings:
When ServerConfig.Enabled = false, the module does not register exports, events, or cabinet state. Set:
to disable weapon validation entirely. Set:
to disable dead, laststand, handcuffed and escorted state validation.

Usage

Example smash flow:

Exports

getNearestCabinetId

Returns the nearest cabinet within 10.0 units. Returns:

getNearestCabinetIdFromCoords

Accepts:
  • vector3
  • vector4
  • Table containing x, y, and z
maxDistance defaults to 10.0. Returns:

canSmashCabinet

Returns true when the player can smash the specified cabinet. Checks:
  • Valid player ped
  • Valid cabinet
  • Cabinet is intact
  • Player state validation (if enabled)
  • Distance validation
  • Weapon validation (if enabled)

smashCabinet

Returns:
When playAnimation is enabled, the server waits for the client animation flow to complete before returning a result.

smashNearestCabinet

Returns:

resetCabinetsInLocation

Accepts either a configured location name or location index. Examples:

Shutters

Shutters are controlled server-side and spawned locally on clients from ServerConfig.Locations. Each location can define its own shutters block next to its cabinet definitions. Example:
The shutters export accepts open, closed and toggle. close is accepted as an alias for closed. isShutterOpen(locationRef) returns whether every shutter part in the requested location is open. ServerConfig.Locations[].shutters.parts[].coords is a direct vec4 world coordinate, including heading. Set ServerConfig.Locations[].shutters.enabled = false to disable shutter state and visuals for one configured location. Set ServerConfig.Locations[].shutters.defaultOpen to control the initial shutter state for one configured location. The configured jewelry locations treat coords as the closed position; open height, animation timing and resync range are hardcoded in the shutter module. zydrec_gj_prop_shutter_02 is hardcoded as a temporary spawned part so it despawns while open and does not clip through the roof.

Debug

Enable debug rendering with:
When enabled, cabinet labels and prop outlines are rendered for development and testing.