Configuration
Configuration
All settings live in config.lua at the resource root. The file is not encrypted and can be edited freely.
Language
Config.Locale = 'es' -- 'es' (Spanish) | 'en' (English)
Add new languages by creating locales/<code>.lua following the same pattern as es.lua / en.lua.
Framework
Config.Framework = 'auto' -- 'auto' | 'qbx' | 'qb' | 'esx'
auto checks for qbx_core → qb-core → es_extended in that order and picks the first one started. Force a specific framework only if you have multiple installed.
Command & Permissions
Config.Command = 'zonasegura'
Config.AdminGroup = 'group.admin' -- ACE permission
Default Creator
Config.DefaultCreator = 'map' -- 'map' | 'freecam'
Determines what opens when an admin runs plain /zonasegura with no sub-argument. Both creators stay available via:
/zonasegura map— force the 2D Leaflet creator/zonasegura freecam— force the 3D in-world creator
Zone Validation
Config.MinPolygonPoints = 3 -- minimum vertices required to save
Config.MaxZoneName = 64 -- character limit
Runtime Enforcement
Config.NearZoneBufferM = 5.0 -- performance gate buffer in meters
Config.OuterLoopMs = 500 -- outer "near any zone" tick interval
NearZoneBufferM is a performance gate only — it widens the area where the precise point-in-polygon check runs, but doesn't expand the actual protection area. Protection is decided by point-in-polygon against the raw polygon vertices, so the protected area is exactly what you drew.
Protection Behavior
Config.Invincible = true
When true, players inside a safezone get SetEntityInvincible(true) — bullets and melee from outside the zone bounce off. A replicated statebag inSafeZone = true is also set so anti-cheats (like suty-landmark) skip the protected player.
Set to false to keep only the weapon-draw lockout and allow damage from outside shooters.
On-screen Badge
Config.TextUI = {
text = 'ESTÁS EN ZONA SEGURA', -- leave nil to fall back to Locale.inside_safezone
icon = 'shield-halved',
position = 'right-center',
style = {
backgroundColor = '#0a3d62',
color = '#ffffff',
borderColor = '#3498db',
},
}
If Config.TextUI.text is nil, the badge falls back to the active locale's inside_safezone string — so switching Config.Locale = 'en' automatically changes the badge text.
Discord Logging (optional)
Config.Discord = {
Webhook = false, -- false = disabled, or set a webhook URL
BotName = 'HoodLife Zonas Seguras',
}
Debug
Config.Debug = false
When true, prints exact enter/exit coords to the F8 client console every time a player crosses a zone boundary. Useful for verifying the protection trigger fires precisely at the polygon edge — walk the perimeter and watch the log.
