JixelPatterns
  • JixelPatterns Documentation
  • Troubleshooting
    • Common Issues
    • Setting Up Locations
    • FAQ
  • Dependency
    • Jim_Bridge
      • Animal Ped Support
      • Script Helpers
      • Loader Functions
      • Callbacks
      • Cameras
      • Context Menus
      • Crafting
      • DrawText
      • Dui Functions
      • Input Creator
      • Inventories
      • Job Functions
      • Make Functions
      • Meta Handlers
      • Notifications
      • Phones
      • Player Functions
      • Poly Zones
      • Progress Bars
      • Scale Entity
      • Shops
      • Skillcheck
      • Society Banking
      • Stash Control
      • Targets
      • Vehicles
      • Wrapper Functions
      • Scaleforms
  • Paid Assets
    • Jim-Mechanic
      • Common Issues
      • Installation
      • Locations
        • Creating a Location
      • Nitrous
      • Harness + Seatbelt
      • Emergency Repair Bench
      • Odometer
      • Speedometer
      • Performance Mods
      • Preview System
      • Repair System
      • Car Lifts
      • Plate Change
      • Push Vehicle
      • Stancer Kit
      • Vehicle Seat Picker
    • Jim-Bakery
      • Installation
    • Jim-BeanMachine
      • Installation
    • Jim-BurgerShot
      • Installation
    • Jim-CatCafe
      • Installation
    • Jim-Henhouse
      • Installation
    • Jim-PizzaThis
      • Installation
    • Jim-Popsdiner
      • Installation
  • Free Assets
    • Jim-Mining
      • Installation
      • How To Use
        • Mining
        • Stone Washing
        • Gold Panning
    • Jim-Recycle
      • Installation
      • How To Use
        • Recycling
        • Dumpster Diving
        • Scrapping
    • Jim-Payments
      • Installation
      • How To Use
    • Jim-Shops
      • Installation
      • How To Use
    • Jim-Boarding
      • Installation
      • How To Use
    • Jim-Trains
      • Installation
      • How To Use
    • Jim-Consumbles
      • Installation
      • How To Use
    • Jim-DJBooth
      • Installation
      • How To Use
    • Jim-JobGarage
      • Installation
      • How To Use
    • Jim-Chairs
      • Installation
    • Jim-Notepad
      • Installation
      • How To Use
Powered by GitBook
On this page
  • polyZone.lua
  • createPoly(data)
  • createCirclePoly(data)
  • removePolyZone(Location)
  1. Dependency
  2. Jim_Bridge

Poly Zones

polyZone.lua

This module provides helpers for creating and removing polygon or circular zones using PolyZone-compatible data structures.

createPoly(data)

Creates a polygonal zone using the detected polyzone library (ox_lib or PolyZone).

Automatically checks which polyzone script is active. When using ox_lib, it converts the provided 2D points to 3D (setting a constant z value) and sets a thickness value.

For PolyZone, it creates the zone and attaches onEnter and onExit callbacks for ease of use.

Example:

createPoly({
    name = 'testZone',
    debug = true,
    points = { vec2(100.0, 100.0), vec2(200.0, 100.0), vec2(200.0, 200.0), vec2(100.0, 200.0) },
    onEnter = function() print("Entered Test Zone") end,
    onExit = function() print("Exited Test Zone") end,
})

createCirclePoly(data)

When using ox_lib, it creates a sphere zone. For PolyZone, it creates a CircleZone and attaches onEnter and onExit callbacks.

Example:

createCirclePoly({
    name = 'circleZone',
    coords = vector3(150.0, 150.0, 20.0),
    radius = 50.0,
    onEnter = function() print("Entered Circle Zone") end,
    onExit = function() print("Exited Circle Zone") end,
})

removePolyZone(Location)

Removes a previously created polygon or circle zone by name.

Detects the active polyzone library and calls the appropriate removal method.

Example:

local zone = createPoly({...})
---
removePolyZone(zone)

PreviousPlayer FunctionsNextProgress Bars

Last updated 3 days ago