alt:V - ZoneManager to trigger events whenever you leave or enter a Polygon

Overview

Features

  • Create 3D polygons
  • Trigger events when enter or leave them

How to use

Create 3D Polygon (without event):

alt.emit("ZoneManager:DrawZoneBy2",startPos, endPos, r, g, b, a);

Or if you want more points:

alt.emit("ZoneManager:DrawZoneBy4",vectors, height, r, g, b, a);
alt.emit("ZoneManager:DrawZoneBy6",vectors, height, r, g, b, a);
alt.emit("ZoneManager:DrawZoneByN",vectors, height, r, g, b, a);

Register or Unregister a zone:

alt.emit("ZoneManager:RegisterZone",vectors, height, zoneName, type, dimension);
alt.emit("ZoneManager:UnregisterZone",zoneName, dimension);
/*
ZoneType 1 = 2PointZone,
ZoneType 2 = 4PointZone,
ZoneType 3 = 6PointZone,
ZoneType 4 = NPointZone
*/

Example:

alt.emit("ZoneManager:RegisterZone",[new alt.Vector3(0,0,70), new alt.Vector3(5,5,80)],10,0,1,0);

Check if a point is in the zone:

alt.emit("ZoneManager:IsPointInZone",point, zoneName, dimension);

(W.I.P) Get a Zone by Index or Name:

alt.emit("ZoneManager:GetZoneByName",name,dimension);
alt.emit("ZoneManager:GetZoneByIndex",index);

Callbacks:

Every function has a callback, which gets triggered when you create or delete something

  • IsZoneRegistered returns: [bool]
  • GetZoneByName returns: [ZoneObject]
  • GetZoneByIndex returns: [ZoneObject]
  • RegisterZone returns: [ZoneObject]
  • UnregisterZone returns: [true if deleted or false if invalid]
  • DrawZoneBy2 returns: [IntervalId]
  • DrawZoneBy4 returns: [IntervalId]
  • DrawZoneBy6 returns: [IntervalId]
  • DrawZoneByN returns: [IntervalId]
  • IsPointInZone returns [bool]
alt.on("ZoneManager:IsZoneRegistered:Callback")
alt.on("ZoneManager:GetZoneByName:Callback")
alt.on("ZoneManager:GetZoneByIndex:Callback")
alt.on("ZoneManager:RegisterZone:Callback")
alt.on("ZoneManager:UnregisterZone:Callback")
alt.on("ZoneManager:DrawZoneBy2:Callback")
alt.on("ZoneManager:DrawZoneBy4:Callback")
alt.on("ZoneManager:DrawZoneBy6:Callback")
alt.on("ZoneManager:DrawZoneByN:Callback")
alt.on("ZoneManager:IsPointInZone:Callback")

Known Bugs:

  • zoneName is sometimes undefined when entering/leaving a zone
  • dimension is 0 everytime, because there is no clientside getter but this will be fixed in the near future
made with by @Phill030
You might also like...

You can use this CLI Tool to clean your iOS and Android projects and keep them updated.

You can use this CLI Tool to clean your iOS and Android projects and keep them updated.

Mobile App Cleaner You can use this CLI Tool to clean your iOS and Android projects and keep them updated. This tool automatizes these items below; Cl

Mar 19, 2022

A simple tool that tells you what food is safe for your dog.

A simple tool that tells you what food is safe for your dog.

Can My Dog Eat A simple tool that tells you what food is safe for your dog. View website Features Can My Dog Eat is a simple website where you can loo

Dec 11, 2022

İnstagram Clone.You can sign in, sign up, upload image, make comment 📷 Used ReactJS, Material UI, Firebase, Firestore Database

 İnstagram Clone.You can sign in, sign up, upload image, make comment 📷 Used ReactJS, Material UI, Firebase, Firestore Database

🟡 instagram-clone This is a instagram clone. You can sign in, sign up, upload image, make comment 📷 ⚡ LIVE To check out the live demo of this app AB

Apr 20, 2022

Organize your life by planning the activities you do on a daily basis.

Task Tracker made using only React. This application is designed to better organize your life by planning the activities you do every day. Don't be la

Oct 10, 2022

The repository helps you learn React by building Netflix :star:

The repository helps you learn React by building Netflix :star:

Learn React by Building Netflix. Click ⭐ if you like the project. Pull Request are highly appreciated ❤️ You can check the advance folder for more Rea

Dec 22, 2022

A Facebook Clone which built with reactJS. You can sign in with your Google Account and send realtime posts.

Facebook Clone with ReactJS A Facebook Clone application that you can sign in with your Google Account and send realtime posts. Facebook Clone Demo Li

Nov 25, 2022

use this to replace redux,you can use useActions to change context value and useActions return a mutable function collection

English | 中文 NOTE react-context-mutation is a lighter and more convenient state manager designed for react applications. It aims to replace the Redux

Feb 22, 2022

🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense!

🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense!

toastify-react-native 🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense! De

Oct 11, 2022

A small tool to help you check package duplicates in `yarn.lock`

A small tool to help you check package duplicates in `yarn.lock`

Yarn Duplicate A small tool to help you check duplicate package and package size in yarn.lock. Usage Change to your project root folder, which have a

Aug 11, 2021
Releases(v1.1.0)
Owner
Phill
Self-Taught C#/Java/JS/TS/Web-Developer
Phill
An application to help in the automatic booking of COVID vaccination slots in India whenever they become available.

Co-WIN automated slot booking Automatically book vaccine slots as and when they become available This application aims to automatically book vaccine s

Arindam Ray 24 Nov 23, 2022
A Google Clone which built with ReactJS. You can click the demo and search whatever you want!

Google Clone with ReactJS A small web app that imitate the desktop web version of google site, you can search whatever you want. Google Clone Demo Lin

Özge Coşkun Gürsucu 36 Aug 14, 2022
To eleventy and beyond! The all-in-one tool for templates where you want them, component frameworks where you need them 🚀

Slinkity ?? This project is heavily under construction! ?? As excited as you may be, we don't recommend this early alpha for production use. Still, gi

Benjamin Holmes 398 Dec 27, 2022
An application that has a frontend (user interface) that allows you to create, read, update or delete (CRUD) products using an API in which you can also create, read, update or delete products.

CRUD app with React and Firebase 9 An application that has a frontend (user interface) that allows you to create, read, update or delete (CRUD) produc

Júlio Bem 3 Sep 28, 2021
The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that allows you to: Display a list of books. Add a book. Remove a selected book.

Bookstore The Bookstore is a website similar to the "Awesome Books" website built in the previous module. You will create an MVP version of it that al

Anuar Shaidenov 6 Jun 12, 2022
Interactive web app where you can Store ,Add and Remove books to organize the books that you've read or the ones willing to read

bookStore Interactive web app where you can Store ,Add and Remove books to organize the books that you've read or the ones willing to read Built With

Yassine Omari 7 Jul 20, 2022
This application allows you to create a list to keep tracks of the books you are reading and check the progress for each book.

Bookstore This is an application built to track the books you are reading and the progress you have made for each book! Additional description about t

Santiago Velosa 4 Feb 27, 2022
A checklist for you to complete as you go through Elden Ring.

Elden Ring Checklist A checklist for you to complete as you go through Elden Ring. Visit the website · Report Bug · Request Feature Table of Contents

Griffin Strayer 23 Dec 23, 2022
An eCommerce website that allows you to sign in and create an account and buy products and pay using PayPal and includes a dashboard that allows you to (add, update, and remove) a product...

An eCommerce website that allows you to sign in and create an account and buy products and pay using PayPal and includes a dashboard that allows you to (add, update, and remove) a product...

Mohamed Aachour 7 Oct 1, 2022