Skip to Content
OLS HUDConfigsSafezone configuration

Safezone configuration

The file configs/safezone.lua defines one or more safe zones: spherical areas on the map where you can restrict combat, weapons, jumping, vehicle speed, and more. Each entry is a table in the returned list.

Mental model

  • coords — center of the zone (X, Y, Z in the game world).
  • radius — size of the sphere in meters. Inside that bubble, the rules apply.
  • options — what players cannot do (or special modes like ghosting) while inside.
  • blip — optional map marker for players.
  • onEnter / onExit / nearby — optional Lua functions if you add custom logic (advanced).

You can duplicate the example block in the file to add more zones and change coordinates and radius for each.

Example entry (reference)

configs/safezone.lua
{ coords = vec3(216.7174, -905.3514, 30.6922), radius = 120.0, borderColor = 1, blip = { ... }, options = { ... }, onEnter = function() end, onExit = function() end, nearby = function() end, }

Options (inside options)

OptionWhat it does
disableDriveByStops shooting from vehicles (drive-by).
disableShootingStops firing weapons.
disableAttackingStops melee attacks.
disableJumpStops jumping.
disableWeaponWheelDisables the weapon wheel (includes integration with ox_inventory where applicable).
disarmOnEnterForces unarmed when entering.
ghostModePlayers pass through each other (no collision).
disableIdleCamStops the idle cinematic camera.
vehicleSpeedLimitMaximum vehicle speed in m/s. The sample file uses a helper kmh(100) to convert km/h.

Blip (map marker)

FieldMeaning
enabledShow a blip on the map.
withRadiusShow a circle around the zone on the map.
alphaTransparency (0–255).
labelText on the map.
colorBlip color ID — FiveM blip colors.
scaleSize (0.0–1.0).
spriteIcon ID — FiveM blip sprites.

Callbacks

CallbackWhen it runs
onEnterPlayer enters the zone.
onExitPlayer leaves the zone.
nearbyWhile the player is near the zone (implementation-specific; use for custom effects).

Scripts integration

Other resources can react to safe zone state using client exports and events — see Safezone in Client exports.

Related: Main config · Common issues

Last updated on