[FREE] [QB] Green Zones


Overview :world_map:

A highly configurable Green Zone script for QBCore, allowing server owners to define safe zones that apply specific restrictions, player state changes, and exemptions based on staff, jobs, or gangs


Features :star:

  • Enforce custom restrictions per zone
  • Disarm, disable shooting/melee/drive-by shooting, lock inventory and more
  • Auto-reset player states: health, stress, hunger, thirst
  • Other states such as invincibility, invisibility (reduced alpha), & no ragdoll while inside zones
  • Staff, job, and gang-based exemptions from restrictions
  • Security checks with optional player drop and logging via fm-logs or discord
  • Full documentation for ease of configuration: Green Zones | Lusty94

Download via GitHub :leftwards_arrow_with_hook:


Documentation :scroll:

  • Documentation for this resource can be found by clicking here

Config Preview :male_detective:

Config.GreenZones = {
    ['pillbox_ems'] = { -- the key must be unique
        info = {-- zone info
            debug = true, -- debug zone
            coords = vector3(310.3, -590.55, 43.29), -- zone spawn coords
            thickness = 10, -- zone thickness
            radius = 65, -- zone radius
        },
        states = { -- define states in this zone
            resetHealth = true, -- resets the players health back to 100 in this zone
            resetStress = true, -- resets the players stress back to 0 in this zone
            resetHunger = true, -- resets the players hunger back to 100 in this zone
            resetThirst = true, -- resets the players thirst back to 100 in this zone
            invincible = true, -- makes the player invincible in this zone
            invisible = true, -- makes the player semi-invisible in this zone
            noRagdoll = true, -- stops players ragdolling in this zone
        },
        restrictions = { -- define restrictions in this zone
            disarm = true, -- disarms the player in this zone if carrying a weapon
            melee = true, -- disable melee in this zone
            shooting = true, -- disable shooting in this zone
            driveby = true, -- disables drive by shooting in this zone
            vehicleWeapons = true, -- disables vehicle weapons in this zone
            lockInventory = true, -- locks the players inventory in this zone
        },
        ignore = { -- define ignore restrictions in this zone
            staff = { -- ignore restrictions for permissions
                --add permissions here or leave this empty
                'admin',
                'god',
                'mod',
            },
            jobs = { -- ignore restrictions for jobs
                --add jobs here or leave this empty
                'ambulance',
            },
            gangs = {-- ignore restrictions for gangs
                --add gangs here or leave this empty
            },
        },
    },
    ['mission_row_police'] = { -- the key must be unique
        info = { -- zone info
            debug = true, -- debug zone
            coords = vector3(447.9, -987.77, 30.69), -- zone spawn coords
            thickness = 10, -- zone thickness
            radius = 50, -- zone radius
        },
        states = { -- define states in this zone
            resetHealth = false, -- resets the players health back to 100 in this zone
            resetStress = false, -- resets the players stress back to 0 in this zone
            resetHunger = false, -- resets the players hunger back to 100 in this zone
            resetThirst = false, -- resets the players thirst back to 100 in this zone
            invincible = false, -- makes the player invincible in this zone
            invisible = false, -- makes the player semi-invisible in this zone
            noRagdoll = false, -- stops players ragdolling in this zone
        },
        restrictions = { -- define restrictions in this zone
            disarm = false, -- disarms the player in this zone if carrying a weapon
            melee = false, -- disable melee in this zone
            shooting = false, -- disable shooting in this zone
            driveby = false, -- disables drive by shooting in this zone
            vehicleWeapons = false, -- disables vehicle weapons in this zone
            lockInventory = false, -- locks the players inventory in this zone
        },
        ignore = { -- define ignore restrictions in this zone
            staff = { -- ignore restrictions for permissions
                --add permissions here or leave this empty
            },
            jobs = { -- ignore restrictions for jobs
                --add jobs here or leave this empty
            },
            gangs = {-- ignore restrictions for gangs
                
            },
        },
    },
    --add more zones as required
}

Preview :video_camera:


Screenshots :selfie:





Supported Scripts :handshake:

Notifications :speech_balloon:

  • qb-core notify✅
  • okokNotify✅
  • mythic_notify✅
  • ox_lib✅
  • qs-notify :warning: (experimental - not tested)

Dependencies‼️

Installation :desktop_computer:

  • Ensure all dependencies are started BEFORE this script
  • Configure the green zones to suit your server needs
  • Define states that are applied in the green zone
  • Define restrictions that are applied in the green zone
  • Define permissions, job or gang names that are exempt from restrictions in the green zone
Code is accessible Yes / open source
Subscription-based No
Lines (approximately) 500+
Requirements qb-core, ox_lib, fm-logs
Support Yes
3 Likes

The formatting of the code seem too AI generated (Gemini to be exact, it has that kinda of one lined codding).

1 Like

I didn’t realise that some code in a single line instead of several made it written by AI :rofl:

it’s free and open source, if you don’t like something, submit a pr :+1:t2: