Installation Guide
This guide will help you install and configure ARS SafeZone on your FiveM server.
Prerequisites
Section titled “Prerequisites”Before installing ARS SafeZone, ensure you have the following dependencies installed:
ox_lib- Library for zone management and UIoxmysql- MySQL database libraryes_extended(ESX) orqb-core(QBCore) - Your chosen framework
Installation Steps
Section titled “Installation Steps”1. Download and Place Resource
Section titled “1. Download and Place Resource”Download ARS SafeZone and place it in your server resources directory:
server-data/resources/[your_folder]/ars_safezone/Note: Do not rename the resource folder. The script checks the resource name and will display an error if renamed.
2. Import Database Tables
Section titled “2. Import Database Tables”Execute the database.sql file in your MySQL database to create the required tables:
CREATE TABLE IF NOT EXISTS `ars_safezone` ( `name` VARCHAR(50) PRIMARY KEY, `label` VARCHAR(50) NOT NULL, `zone` LONGTEXT DEFAULT NULL, `options` LONGTEXT DEFAULT NULL);3. Configure Framework
Section titled “3. Configure Framework”Open shared/main.lua and set your framework:
-- Choose your framework: 'esx' or 'qb'Config.Framework = 'auto'The script will auto-detect your framework if set to 'auto'. You can also explicitly set it to 'esx' or 'qb'.
4. Add to Server Config
Section titled “4. Add to Server Config”Add the resource and its dependencies to your server.cfg:
ensure oxmysqlensure ox_libensure es_extended-- ORensure qb-core
ensure ars_safezoneThe order is important: ensure frameworks and dependencies before ars_safezone.
Verification
Section titled “Verification”After installation, verify that the script is working correctly:
- Start your server and join as a player
- Check that
ars_safezoneappears in the server console without errors - Join the game and try creating a test safe zone as an admin
- Verify that weapon restrictions and other zone options function correctly
Updating
Section titled “Updating”To update ARS SafeZone to a new version:
- Stop your server
- Backup your database table
ars_safezoneto prevent data loss - Replace the old
ars_safezonefolder with the new version - Start your server
- Check for any new configuration options in
shared/main.lua
Warning: Always backup your database before updating, especially if there are schema changes in the new version.
Troubleshooting
Section titled “Troubleshooting”Script Does Not Start
Section titled “Script Does Not Start”Issue: The resource shows errors in console and does not start.
Fix:
- Ensure all dependencies (
ox_lib,oxmysql) are installed and started beforears_safezone - Verify your framework (
es_extendedorqb-core) is running - Check that you have not renamed the resource folder
Zones Not Loading
Section titled “Zones Not Loading”Issue: Safe zones are not appearing in-game after creation.
Fix:
- Verify the
ars_safezonedatabase table exists and has data - Check the MySQL connection in
oxmysql - Enable debug mode in
shared/main.lua:Config.Debug = true - Check the server console for zone loading errors
Commands Not Working
Section titled “Commands Not Working”Issue: Admin commands do nothing when used.
Fix:
- Verify your admin configuration in
shared/main.lua - Check that you have the correct admin group, license, or identifier configured
- Ensure you are using the correct command names as configured in
Config.Commands
Weapon Restrictions Not Applying
Section titled “Weapon Restrictions Not Applying”Issue: Players can still use weapons inside safe zones.
Fix:
- Check that the zone option
disableWeaponsis enabled - Verify that the player’s weapon is not whitelisted in
Config.WhitelistedWeaponsorConfig.WhitelistedJobWeapons - Ensure the player is not an admin with bypass permissions enabled for that zone
Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.