Giter VIP home page Giter VIP logo

polyzone's Introduction

PolyZone

PolyZone is a FiveM mod to define zones of different shapes and test whether a point is inside or outside of the zone

PolyZone around the prison

Download

Click here to go to the releases page and download the latest release

Using PolyZone in a Script

In order to use PolyZone in your script, you must at least include PolyZone's client.lua directly in your __resource.lua or fxmanifest.lua. You can do that by using FiveM's @ syntax for importing resource files:

client_scripts {
    '@PolyZone/client.lua',
    'your_scripts_client.lua',
}

This will allow you to create PolyZones in your script, but will not import other zones, such as CircleZone, BoxZone, etc. All the other zones are extra, and require their own explicit imports. Here is a client_scripts value that will include all the zones. Note the relative order of these imports, as the ordering is necessary! Many zones rely on each other, for example EntityZone inherits from BoxZone, and all zones inherit from PolyZone (client.lua).

client_scripts {
  '@PolyZone/client.lua',
  '@PolyZone/BoxZone.lua',
  '@PolyZone/EntityZone.lua',
  '@PolyZone/CircleZone.lua',
  '@PolyZone/ComboZone.lua',
  'your_scripts_client.lua'
}

Documentation

For additional information on how to use PolyZone, please take a look at the wiki

Troubleshooting and Support

For help troubleshooting issues you've encountered (that aren't in the FAQ), or to suggest new features, use the issues page. Just a reminder though, I do this in my free time and so there is no guarantee an issue will be fixed or a feature will be added. In lieu of my limited time, I will prioritize issues and bugs over features.

FAQ - Frequently Asked Questions

I'm getting the error attempt to index a nil value when creating a zone, what's wrong?

Did you include all the necessary scripts in your __resource.lua or fxmanifest.lua? Remember some zones require other zones, like EntityZone.lua requires BoxZone.lua and BoxZone.lua requires client.lua.

I'm getting no errors, but I can't see my zone in the right place when I turn on debug drawing

If you are using them, is minZ and maxZ set correctly? Or if you are using a CircleZone with useZ=true, is your center's Z value correct? If using a PolyZone, did you manually select all your points, or use the creation script? If you did it manually, the ordering of the points could be causing issues. Are you using the correct option to enable debug drawing? For PolyZones, you can use debugPoly and debugGrid, but for other zones, debugPoly is the only one that works.

Is PolyZone faster than a distance check?

There's a page in the wiki for that, here.

License

Please see the LICENSE file. That file will always overrule anything mentioned in the README.md or wiki

polyzone's People

Contributors

mkafrin avatar russianronin avatar mkeefeus avatar spudgun avatar user123441221 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.