Safes

Safes

£10.00

Add to Basket

Description: This script creates a safe/stash system where players can place personal storage safes in the game world. Players can:


a4d4b288cc7e12edc98a3d2c603acf21122c7880.pnge019f1b7962246aa8b02c76479a171aa148331d8.png

  • Place safes in the world
  • Set access codes for their safes
  • Store items in their safes
  • Destroy their safes
  • Access their safes with a code system
  • Own multiple safes (up to a configurable limit)

Key Features:

  • Password protection system
  • Ownership verification
  • Persistent storage (saves to database)
  • Visual smoke effects when destroying safes
  • Vegetation clearing around safe placement (optional)
  • Target system integration for interaction

Config Options:

luaCopyConfig.EnableVegModifier = true  // Clears vegetation around safe
Config.StashMaxWeight = 5000000  // Maximum weight capacity
Config.StashMaxSlots = 60        // Number of inventory slots
Config.DestroyTime = 10000       // Time to destroy safe (in ms)
Config.MaxStashes = 5            // Maximum safes per character
Config.StashProp = 'p_safe01'    // Safe prop model

Dependencies:

  1. RSG-Core (RedM framework)
  2. RSG-Target (for interaction)
  3. RSG-Inventory (for storage system)
  4. ox_lib (for notifications and UI elements)
  5. MySQL (for database storage)

Database Integration: The script uses MySQL to store:

  • Safe locations
  • Safe ownership (citizenid)
  • Access codes
  • Safe properties
  • Inventory contents (through RSG-Inventory)

Usage:

  1. Players can create safes using either:
    • Using a "safe" item from inventory
  2. Safe Interaction:
    • Set access codes
    • Open inventory
    • Destroy safe (owner only)
    • Access requires correct code if set

Required Database Tables:

  • player_safes: Stores safe data (properties, propid, citizenid, access_code)
  • Inventory tables from RSG-Inventory for item storage

Security Features:

  • Server-side ownership verification
  • Access code verification
  • Anti-spam measures
  • Permission checks for destruction

Technical Details:

  • Uses prop system for physical representation
  • Implements client-server synchronization
  • Handles resource stopping/starting
  • Includes prop placement validation
  • Target system for interaction options

The script is well-structured with separate client and server files, making it maintainable and expandable. It's designed specifically for RedM's environment and integrates well with the RSG framework ecosystem.