EJJ Prison System
Hey everyone! I’ve been working on this prison script for a while and wanted to share it with the community. It’s way more than just your typical jail timeout - players can actually do stuff while they’re locked up.Instead of just sitting around waiting for your sentence to end, players can:
- Work prison jobs (cooking, electrical work, gym training) to reduce their time
- Collect materials around the prison to craft escape tools
- Dig tunnels to break out (with proper animations and everything)
- Buy stuff from the prison shop if they need food/water
Prison Management:
Interactive Jobs:
- Time-based sentences that persist through disconnects
- Automatic inventory management (items removed/restored)
- Police commands: /jail, /unjail, /jailstatus
- Configurable locations and timers
Escape System:
- Kitchen work with cooking minigames
- Electrical repairs around the prison
- Physical training/workout equipment
- All jobs reduce your sentence time
Shop & Crafting:
- Craft shovels from materials found around prison
- Dig escape tunnels with realistic animations
- Alarms trigger when you break out
- Tunnels persist until reset by admins
Technical Stuff:
- Buy essentials from prison NPCs
- Gather resources that respawn over time
- Interactive crafting system
- Works with ESX Legacy, QBCore, and QBX
- 8 languages supported (English, Danish, German, Spanish, Swedish, Japanese, Norwegian, Portuguese)
- ox_lib integration for modern UI
- MySQL database with auto-setup
- Export functions for developers
/jail [<span>id</span>] [<span>time</span>] - Jail someone (police only)<br>/unjail [<span>id</span>] - Release someone (police only)<br>/jailstatus [<span>id</span>] - Check jail <span>time</span> remaining<br>/resettunnel - Reset escape tunnel (admin only)<br>
For developers who want to integrate this with other scripts:
- Extract to resources folder
- Add ‘ensure ejj_prison’ to server.cfg
- Configure settings in config.lua
- Restart server (database creates automatically)
Server:
Client:
- exports[‘ejj_prison’]:JailPlayer(playerId, jailTime)
- exports[‘ejj_prison’]:UnjailPlayer(playerId)
Works great with police MDTs, court systems, and admin panels.
- exports[‘ejj_prison’]:IsPlayerJailed()
- exports[‘ejj_prison’]:GetJailTime()
The script has been optimized for performance - no unnecessary loops or constant checks. Everything runs on events and the code is clean.
I’ve tried to make this as realistic as possible while still being fun. Players aren’t just stuck doing nothing, they have choices to make - work to reduce time safely, or risk everything for a chance at freedom.
Let me know what you think! Always open to feedback and suggestions.