local circle_zone = { id ="example_circle", coords =vector3(200.0, -800.0, 30.0), radius =10.0, debug =true,}--- Utils objectutils.zones.add_circle(circle_zone)print("Circle Zone Added:", circle_zone.id)--- Direct exportexports.boii_utils:add_circle_zone(circle_zone)
add_box_zone
Add a box zone with custom dimensions.
--- Define box optionslocal box_zone = { id ="example_box", coords =vector3(300.0, -700.0, 30.0), width =5.0, depth =10.0, height =3.0, heading =0.0, debug =true,}--- Utils objectutils.zones.add_box(box_zone)print("Box Zone Added:", box_zone.id)--- Direct exportexports.boii_utils:add_box_zone(box_zone)
remove_zone
Remove a zone by its unique identifier.
--- Specify zone idlocal zone_id ="example_circle"--- Utils objectutils.zones.remove_zone(zone_id)print("Zone Removed:", zone_id)--- Direct exportexports.boii_utils:remove_zone(zone_id)
is_in_zone
Determine if a specific point is within any active zone.
--- Retrieve or specify some coords; here we use the player.local player =GetEntityCoords(PlayerPedId())--- Utils objectlocal is_inside = utils.zones.is_in_zone(player)print("Player Inside Zone:", is_inside)--- Direct exportlocal is_inside = exports.boii_utils:is_in_zone(player)
Server Functions
get_zones
Use the following to retrieve zones server side.
--- Utils objectlocal zones = utils.zones.get_zones()print('Zones:', json.encode(zones))--- Direct exportlocal zones = exports.boii_utils:get_zones()