zydrec-robbery-lib
Installation
Keep the resource folder name as:Configuration
Configuration is located in:ServerConfig.Enabled = false, the module does not register exports, events, or cabinet state.
Set:
Usage
Example smash flow:Exports
getNearestCabinetId
Returns the nearest cabinet within10.0 units.
Returns:
getNearestCabinetIdFromCoords
Accepts:vector3vector4- Table containing
x,y, andz
maxDistance defaults to 10.0.
Returns:
canSmashCabinet
Returnstrue 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: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 fromServerConfig.Locations. Each location can define its own shutters block next to its cabinet definitions.
Example:
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.
