Configuration
This guide explains all configuration options available in shared/main.lua for ARS SafeZone.
Core Settings
Section titled “Core Settings”Debug Mode
Section titled “Debug Mode”Config.Debug = falseWhen enabled, debug messages print to the console and zone polygons are rendered in-game with debug colors. Use this when creating zones or troubleshooting issues.
Framework Selection
Section titled “Framework Selection”Config.Framework = 'auto'Choose which framework the script should use:
'auto'- Automatically detect ESX or QBCore (recommended)'esx'- Force ESX framework'qb'- Force QBCore framework
Command Names
Section titled “Command Names”Config.Commands = { createsafezone = 'createsafezone', deletesafezone = 'deletesafezone', zonesetting = 'zonesetting',}Customize the command names for admin functions. Change these values to avoid conflicts with other resources.
Admin Configuration
Section titled “Admin Configuration”Configure three different methods for granting admin access to safe zone management.
Option 1: Group-Based Permissions
Section titled “Option 1: Group-Based Permissions”Config.AdminWithGroup = { ['admin'] = true, ['god'] = true,}- Works with QBCore’s permission system
- In ESX, uses
xPlayer.getGroup()to check admin status - Add your server’s admin groups as keys with
trueas values
Option 2: License-Based Permissions
Section titled “Option 2: License-Based Permissions”Config.AdminWithLicense = { ['license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'] = true,}- Uses the player’s rockstar license identifier
- Add your admins’ full license strings (found in
server.logor through other admin tools) - Format must include the
license:prefix
Option 3: Identifier-Based Permissions
Section titled “Option 3: Identifier-Based Permissions”Config.AdminWithIdentifier = { ['xxxxxxxx'] = true,}- Uses the framework’s character identifier
- For ESX, this is the character identifier from the database
- For QBCore, this is the citizen ID
- Use this method when you need to grant admin access to specific characters only
Tip: You can use multiple permission methods simultaneously. The script checks each method in order.
Alert Style Configuration
Section titled “Alert Style Configuration”Config.AlertStyle = { icon = 'hand', position = 'top-center', textColor = 'white', borderRadius = 5, backgroundColor = 'rgb(187 72 72)',}Customize the appearance of notification alerts shown to players:
icon: Font Awesome icon name (withoutfa-prefix)position: Alert position on screen (top-center,top-left,top-right,bottom-center,bottom-left,bottom-right,center)textColor: CSS color value for textborderRadius: Border radius in pixelsbackgroundColor: CSS color value for background (can be hex, rgb, rgba, or named colors)
Alert Auto-Hide
Section titled “Alert Auto-Hide”Config.HideAlertAfterDelay = falseConfig.HideAlertDelay = 6HideAlertAfterDelay: Automatically hide alerts after the delayHideAlertDelay: Time in seconds before alerts are hidden (if enabled)
Speed Unit Configuration
Section titled “Speed Unit Configuration”Config.SpeedUnit = 'kmh'Choose the unit for displaying and setting speed limits:
'kmh'- Kilometers per hour'mph'- Miles per hour
The script automatically sets the conversion factor:
if Config.SpeedUnit == 'mph' then Config.SpeedConversionFactor = 2.237 -- Convert m/s to mphelse Config.SpeedConversionFactor = 3.6 -- Convert m/s to km/hendWeapon Whitelists
Section titled “Weapon Whitelists”Global Weapon Whitelist
Section titled “Global Weapon Whitelist”Config.WhitelistedWeapons = { --[`weapon_pistol`] = true, --[`weapon_combatpistol`] = true,}Weapons listed here are allowed in all safe zones (when allowWhitelistedWeapons is enabled for a zone). Uncomment and add weapon hash keys to whitelist specific weapons for all players.
Job Weapon Whitelist
Section titled “Job Weapon Whitelist”Config.WhitelistedJobWeapons = { police = { [`weapon_stungun`] = { 0, 1, 2, 3, 4 }, [`weapon_combatpistol`] = { 2, 3, 4 }, }, ambulance = { [`weapon_stungun`] = { 0, 1, 2, 3, 4 }, },}Allows specific weapons for specific job grades in safe zones:
- First level: Job name (
police,ambulance, etc.) - Second level: Weapon hash
- Value: Array of allowed grades (0 is lowest, higher numbers are higher ranks)
Example: Police can use stun guns at grades 0-4, but only grades 2+ can use combat pistols.
Default Zone Options
Section titled “Default Zone Options”These options apply as defaults when creating new safe zones. They can be overridden per zone.
Config.DefaultSafeZoneOptions = { disableWeapons = true, disableVehicleDamage = true, disablePlayerInvisible = false, allowWhitelistedWeapons = true, allowWhitelistedJobWeapons = true, enableVehicleSpeedLimit = false, vehicleSpeedLimit = 30, entryMessage = 'You have entered a safe zone', exitMessage = 'You have left a safe zone',}Option Explanations
Section titled “Option Explanations”| Option | Type | Description |
|---|---|---|
disableWeapons | boolean | Disable all weapons inside the zone |
disableVehicleDamage | boolean | Prevent vehicles from taking damage |
disablePlayerInvisible | boolean | Make players invincible (note: misnamed option) |
allowWhitelistedWeapons | boolean | Allow weapons from Config.WhitelistedWeapons |
allowWhitelistedJobWeapons | boolean | Allow weapons from Config.WhitelistedJobWeapons |
enableVehicleSpeedLimit | boolean | Enforce speed limit for vehicles |
vehicleSpeedLimit | number | Speed limit value in configured unit |
entryMessage | string | Notification when entering the zone |
exitMessage | string | Notification when leaving the 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.